FIX: Updated protocol check to become more stringent.

This commit is contained in:
Jeremy Shipman 2013-05-20 12:46:44 +12:00
parent d21fd1f0bb
commit b1ba8bd05b

View File

@ -62,9 +62,8 @@ class HTTP {
public static function absoluteURLs($html) {
$html = str_replace('$CurrentPageURL', $_SERVER['REQUEST_URI'], $html);
return HTTP::urlRewriter($html, function($url) {
//no need to rewrite, if uri has a protocol
//(determined here by existence of reserved URI character ":")
if(stripos($url, ":") !== false){
//no need to rewrite, if uri has a protocol (determined here by existence of reserved URI character ":")
if(preg_match('/^\w+:/', $url)){
return $url;
}
return Director::absoluteURL($url, true);