[html] Fix img src replacement not working

strpos returns false if the needle was not found. See:
http://php.net/manual/en/function.strpos.php#refsect1-function.strpos-returnvalues
This commit is contained in:
logmanoriginal 2017-02-18 13:13:40 +01:00
parent 5de03d6b9f
commit bb8e7495d8

View file

@ -280,9 +280,9 @@ $keptText = array()){
function defaultImageSrcTo($content, $server){
foreach($content->find('img') as $image){
if(is_null(strpos($image->src, "http"))
&& is_null(strpos($image->src, "//"))
&& is_null(strpos($image->src, "data:")))
if(strpos($image->src, 'http') === false
&& strpos($image->src, '//') === false
&& strpos($image->src, 'data:') === false)
$image->src = $server . $image->src;
}
return $content;