Merge pull request #1832 from oddnoc/is_absolute_url-regex

Anchor regex in Director#is_absolute_url()
This commit is contained in:
Ingo Schommer 2013-05-08 01:40:23 -07:00
commit d74c4aadc1

View File

@ -579,7 +579,7 @@ class Director implements TemplateGlobalProvider {
// Check for more than one leading slash without a protocol.
// While not a RFC compliant absolute URL, it is completed to a valid URL by some browsers,
// and hence a potential security risk. Single leading slashes are not an issue though.
|| preg_match('/\s*[\/]{2,}/', $url)
|| preg_match('%^\s*/{2,}%', $url)
|| (
// If a colon is found, check if it's part of a valid scheme definition
// (meaning its not preceded by a slash).