forked from wallabag/wallabag
Fix images downloading with numeric HTML entity
This commit is contained in:
@ -86,12 +86,14 @@ class DownloadImages
|
||||
continue;
|
||||
}
|
||||
|
||||
// if image contains "&" and we can't find it in the html it might be because it's encoded as &
|
||||
if (false !== stripos($image, '&') && false === stripos($html, $image)) {
|
||||
$image = str_replace('&', '&', $image);
|
||||
}
|
||||
|
||||
$html = str_replace($image, $newImage, $html);
|
||||
// if image contains "&" and we can't find it in the html it might be because it's encoded as & or unicode
|
||||
if (false !== stripos($image, '&') && false === stripos($html, $image)) {
|
||||
$imageAmp = str_replace('&', '&', $image);
|
||||
$html = str_replace($imageAmp, $newImage, $html);
|
||||
$imageUnicode = str_replace('&', '&', $image);
|
||||
$html = str_replace($imageUnicode, $newImage, $html);
|
||||
}
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
||||
Reference in New Issue
Block a user