mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #1832 from oddnoc/is_absolute_url-regex
Anchor regex in Director#is_absolute_url()
This commit is contained in:
commit
d74c4aadc1
@ -579,7 +579,7 @@ class Director implements TemplateGlobalProvider {
|
|||||||
// Check for more than one leading slash without a protocol.
|
// 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,
|
// 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.
|
// 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
|
// If a colon is found, check if it's part of a valid scheme definition
|
||||||
// (meaning its not preceded by a slash).
|
// (meaning its not preceded by a slash).
|
||||||
|
Loading…
Reference in New Issue
Block a user