Commit bee82b29 by Alexander Makarov

Fixed URL parsing so it's now properly giving 404 for URLs like…

Fixed URL parsing so it's now properly giving 404 for URLs like `http://example.com//////site/about`
parent dc45de12
...@@ -28,6 +28,7 @@ Yii Framework 2 Change Log ...@@ -28,6 +28,7 @@ Yii Framework 2 Change Log
- Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe) - Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe)
- Bug: Fixed issue with tabular input on ActiveField::radio() and ActiveField::checkbox() (jom) - Bug: Fixed issue with tabular input on ActiveField::radio() and ActiveField::checkbox() (jom)
- Bug: Fixed the issue that query cache returns the same data for the same SQL but different query methods (qiangxue) - Bug: Fixed the issue that query cache returns the same data for the same SQL but different query methods (qiangxue)
- Bug: Fixed URL parsing so it's now properly giving 404 for URLs like `http://example.com//////site/about` (samdark)
- Enh #46: Added Image extension based on [Imagine library](http://imagine.readthedocs.org) (tonydspaniard) - Enh #46: Added Image extension based on [Imagine library](http://imagine.readthedocs.org) (tonydspaniard)
- Enh #364: Improve Inflector::slug with `intl` transliteration. Improved transliteration char map. (tonydspaniard) - Enh #364: Improve Inflector::slug with `intl` transliteration. Improved transliteration char map. (tonydspaniard)
- Enh #797: Added support for validating multiple columns by `UniqueValidator` and `ExistValidator` (qiangxue) - Enh #797: Added support for validating multiple columns by `UniqueValidator` and `ExistValidator` (qiangxue)
......
...@@ -584,7 +584,11 @@ class Request extends \yii\base\Request ...@@ -584,7 +584,11 @@ class Request extends \yii\base\Request
throw new InvalidConfigException('Unable to determine the path info of the current 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;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment