From 0049ef390ba1984439637e0b945629ab0f70e52e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 21 Mar 2022 21:26:30 +0100 Subject: [PATCH] Add some basic test --- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 2 +- tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index 3acf2f7e6..a8a6ccad8 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -351,7 +351,7 @@ class DownloadImages $this->logger->debug('DownloadImages: Checking extension (alternative)', ['ext' => $ext]); } - if (!\in_array($ext, ['jpeg', 'jpg', 'gif', 'png','webp'], true)) { + if (!\in_array($ext, ['jpeg', 'jpg', 'gif', 'png', 'webp'], true)) { $this->logger->error('DownloadImages: Processed image with not allowed extension. Skipping: ' . $imagePath); return false; diff --git a/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php index 654246e10..6b33cbc13 100644 --- a/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php +++ b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php @@ -65,6 +65,7 @@ class DownloadImagesTest extends TestCase ['image/jpeg', 'jpeg'], ['image/png', 'png'], ['image/gif', 'gif'], + ['image/webp', 'webp'], ]; }