mirror of
https://github.com/wallabag/wallabag.git
synced 2025-10-10 19:32:07 +00:00
Merge pull request #5594 from wallabag/fix/download-image-overlapping
This commit is contained in:
commit
03e1fd6d73
3 changed files with 29 additions and 5 deletions
|
@ -72,13 +72,16 @@ class DownloadImages
|
|||
{
|
||||
$imagesUrls = self::extractImagesUrlsFromHtml($html);
|
||||
|
||||
// ensure images aren't overlapping
|
||||
arsort($imagesUrls);
|
||||
|
||||
$relativePath = $this->getRelativePath($entryId);
|
||||
|
||||
// download and save the image to the folder
|
||||
foreach ($imagesUrls as $image) {
|
||||
$imagePath = $this->processSingleImage($entryId, $image, $url, $relativePath);
|
||||
$newImage = $this->processSingleImage($entryId, $image, $url, $relativePath);
|
||||
|
||||
if (false === $imagePath) {
|
||||
if (false === $newImage) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -87,7 +90,7 @@ class DownloadImages
|
|||
$image = str_replace('&', '&', $image);
|
||||
}
|
||||
|
||||
$html = str_replace($image, $imagePath, $html);
|
||||
$html = str_replace($image, $newImage, $html);
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue