Merge pull request #3323 from dhensby/patch-2

FIX Handle empty URLs that are made absolute
This commit is contained in:
Sean Harvey 2014-07-30 15:42:34 +12:00
commit 76f719c94b

View File

@ -425,7 +425,7 @@ class Director implements TemplateGlobalProvider {
}
if(substr($url,0,4) != "http") {
if($url[0] != "/") $url = Director::baseURL() . $url;
if(strpos($url, '/') !== 0) $url = Director::baseURL() . $url;
// Sometimes baseURL() can return a full URL instead of just a path
if(substr($url,0,4) != "http") $url = self::protocolAndHost() . $url;
}