mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Handle empty URLs that are made absolute
When the email sender makes the links absolute, it can't handle empty `href` or `src` attributes as there's no expectation that the string length could be 0
This commit is contained in:
parent
350ee4d421
commit
419f308544
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user