Permalink
Browse files

FIX: Updated protocol check to become more stringent.

  • Loading branch information...
1 parent d21fd1f commit b1ba8bd05b5b61e9f9ec4e1316facba570b841db @jedateach jedateach committed May 20, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 control/HTTP.php
View
@@ -62,9 +62,8 @@ public static function filename2url($filename) {
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);

0 comments on commit b1ba8bd

Please sign in to comment.