From bb8e7495d83e629d855c16cd148c684a05766b03 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 18 Feb 2017 13:13:40 +0100 Subject: [PATCH] [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 --- lib/html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/html.php b/lib/html.php index 1b9b5ab..24a2cab 100644 --- a/lib/html.php +++ b/lib/html.php @@ -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;