Fixed URL parsing so it's now properly giving 404 for URLs like http://example.com//////site/about

This commit is contained in:
Alexander Makarov
2014-01-07 04:40:38 +04:00
parent dc45de127c
commit bee82b29ad
2 changed files with 6 additions and 1 deletions

View File

@ -584,7 +584,11 @@ class Request extends \yii\base\Request
throw new InvalidConfigException('Unable to determine the path info of the current request.');
}
return ltrim($pathInfo, '/');
if ($pathInfo[0] === '/') {
$pathInfo = substr($pathInfo, 1);
}
return $pathInfo;
}
/**