Replace protocol-relative url by http://

This commit is contained in:
Frédéric Guillot 2013-10-21 21:51:16 -04:00
parent 81819691c1
commit ebc835cf78

View File

@ -152,15 +152,12 @@ class Filter
// Iframe source whitelist, everything else is ignored
public static $iframe_whitelist = array(
'//www.youtube.com',
'http://www.youtube.com/',
'https://www.youtube.com/',
'http://player.vimeo.com/',
'https://player.vimeo.com/',
'//player.vimeo.com/',
'http://www.dailymotion.com',
'https://www.dailymotion.com',
'//www.dailymotion.com',
);
@ -240,6 +237,9 @@ class Filter
$value = $attributes['data-src'];
}
// Replace protocol-relative url // by http://
if (substr($value, 0, 2) === '//') $value = 'http:'.$value;
$attr_data .= ' '.$attribute.'="'.$value.'"';
$used_attributes[] = $attribute;
}