fixed CS
This commit is contained in:
parent
f03dc6eec5
commit
ba1cd26237
@ -187,15 +187,15 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt
|
|||||||
|
|
||||||
if ('' === $url) {
|
if ('' === $url) {
|
||||||
$url = '/';
|
$url = '/';
|
||||||
} else if (preg_match($this->urlEncodingSkipRegexp, $url)) {
|
} elseif (preg_match($this->urlEncodingSkipRegexp, $url)) {
|
||||||
// the contexts base URL is already encoded (see Symfony\Component\HttpFoundation\Request)
|
// the context base URL is already encoded (see Symfony\Component\HttpFoundation\Request)
|
||||||
$url = strtr(rawurlencode($url), $this->decodedChars);
|
$url = strtr(rawurlencode($url), $this->decodedChars);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3
|
// the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3
|
||||||
// so we need to encode them as they are not used for this purpose here
|
// so we need to encode them as they are not used for this purpose here
|
||||||
// otherwise we would generate a URI that, when followed by a user agent (e.g. browser), does not match this route
|
// otherwise we would generate a URI that, when followed by a user agent (e.g. browser), does not match this route
|
||||||
if(false !== strpos($url, '/.')) {
|
if (false !== strpos($url, '/.')) {
|
||||||
$url = strtr($url, array('/../' => '/%2E%2E/', '/./' => '/%2E/'));
|
$url = strtr($url, array('/../' => '/%2E%2E/', '/./' => '/%2E/'));
|
||||||
if ('/..' === substr($url, -3)) {
|
if ('/..' === substr($url, -3)) {
|
||||||
$url = substr($url, 0, -2).'%2E%2E';
|
$url = substr($url, 0, -2).'%2E%2E';
|
||||||
|
Reference in New Issue
Block a user