]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(previews): Stop returning true when getimagesize() fails 46342/head
authorJosh Richards <josh.t.richards@gmail.com>
Sat, 6 Jul 2024 22:01:25 +0000 (18:01 -0400)
committerJosh <josh.t.richards@gmail.com>
Tue, 16 Jul 2024 01:06:49 +0000 (21:06 -0400)
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
lib/private/legacy/OC_Image.php

index cc6968839d44f3b60aa7de5297215aee1b3fadc8..622c1704b098bac7ece455fb1abd859f4a92d42e 100644 (file)
@@ -569,7 +569,7 @@ class OC_Image implements \OCP\IImage {
        private function checkImageSize($path) {
                $size = @getimagesize($path);
                if (!$size) {
-                       return true;
+                       return false;
                }
 
                $width = $size[0];
@@ -590,7 +590,7 @@ class OC_Image implements \OCP\IImage {
        private function checkImageDataSize($data) {
                $size = @getimagesizefromstring($data);
                if (!$size) {
-                       return true;
+                       return false;
                }
 
                $width = $size[0];
@@ -637,7 +637,7 @@ class OC_Image implements \OCP\IImage {
                                        if (!$this->checkImageSize($imagePath)) {
                                                return false;
                                        }
-                                       if (getimagesize($imagePath) !== false) {
+                                       if (@getimagesize($imagePath) !== false) {
                                                $this->resource = @imagecreatefromjpeg($imagePath);
                                        } else {
                                                $this->logger->debug('OC_Image->loadFromFile, JPG image not valid: ' . $imagePath, ['app' => 'core']);