diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/DownloadImages.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index 0d330d2a..f7c26a38 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php | |||
@@ -66,6 +66,12 @@ class DownloadImages | |||
66 | continue; | 66 | continue; |
67 | } | 67 | } |
68 | 68 | ||
69 | // if image contains "&"" and we can't find it in the html | ||
70 | // it might be because it's encoded as & | ||
71 | if (false !== stripos($image, '&') && false === stripos($html, $image)) { | ||
72 | $image = str_replace('&', '&', $image); | ||
73 | } | ||
74 | |||
69 | $html = str_replace($image, $imagePath, $html); | 75 | $html = str_replace($image, $imagePath, $html); |
70 | } | 76 | } |
71 | 77 | ||
@@ -114,7 +120,7 @@ class DownloadImages | |||
114 | $ext = $this->mimeGuesser->guess($res->getHeader('content-type')); | 120 | $ext = $this->mimeGuesser->guess($res->getHeader('content-type')); |
115 | $this->logger->debug('DownloadImages: Checking extension', ['ext' => $ext, 'header' => $res->getHeader('content-type')]); | 121 | $this->logger->debug('DownloadImages: Checking extension', ['ext' => $ext, 'header' => $res->getHeader('content-type')]); |
116 | if (!in_array($ext, ['jpeg', 'jpg', 'gif', 'png'], true)) { | 122 | if (!in_array($ext, ['jpeg', 'jpg', 'gif', 'png'], true)) { |
117 | $this->logger->error('DownloadImages: Processed image with not allowed extension. Skipping '.$imagePath); | 123 | $this->logger->error('DownloadImages: Processed image with not allowed extension. Skipping: '.$imagePath); |
118 | 124 | ||
119 | return false; | 125 | return false; |
120 | } | 126 | } |