1
0
Fork 0
forked from blallo/rss-bridge

[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){ function defaultImageSrcTo($content, $server){
foreach($content->find('img') as $image){ foreach($content->find('img') as $image){
if(is_null(strpos($image->src, "http")) if(strpos($image->src, 'http') === false
&& is_null(strpos($image->src, "//")) && strpos($image->src, '//') === false
&& is_null(strpos($image->src, "data:"))) && strpos($image->src, 'data:') === false)
$image->src = $server . $image->src; $image->src = $server . $image->src;
} }
return $content; return $content;