git-svn-id: https://msi/svn/firstRepo/Service/trunk@23 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2014-12-10 15:19:03 +00:00
parent 4f363403ca
commit f7d8f47f57
30 changed files with 4732 additions and 3053 deletions
+4 -1
View File
@@ -14,7 +14,10 @@ $app = new \Slim\Slim();
$app->hook('slim.before.router', function () use ($app, $allowedHost) {
$currentRefererRequest = $app->request()->getReferer();
$currentRefererRequest = substr(substr($currentRefererRequest, 7), 0, strpos(substr($currentRefererRequest, 7), '/'));
$currentRefererRequest = substr($currentRefererRequest, 7); //Senza http://
$indexDoublePoint = strpos($currentRefererRequest, ':');
$indexFirstSlash = strpos($currentRefererRequest, '/');
$currentRefererRequest = substr($currentRefererRequest, 0, $indexDoublePoint > 0 && $indexDoublePoint < $indexFirstSlash ? $indexDoublePoint : $indexFirstSlash );
if(!in_array($currentRefererRequest, $allowedHost))
{
$app->halt(500, "Generic error occurred");