diff options
author | Josh Richards <josh.t.richards@gmail.com> | 2024-07-06 18:01:25 -0400 |
---|---|---|
committer | Josh <josh.t.richards@gmail.com> | 2024-07-15 21:06:49 -0400 |
commit | c0e1503ce14ffcd06a1e72e945335460d4a996ab (patch) | |
tree | 367f5f6d165baf03475d6ab9a9d6bd949de2f1b6 /lib/private/legacy | |
parent | 70dd8d513bf73c8d56fea2aae4a02718a328f6e3 (diff) | |
download | nextcloud-server-c0e1503ce14ffcd06a1e72e945335460d4a996ab.tar.gz nextcloud-server-c0e1503ce14ffcd06a1e72e945335460d4a996ab.zip |
fix(previews): Stop returning true when getimagesize() fails
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_Image.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php index cc6968839d4..622c1704b09 100644 --- a/lib/private/legacy/OC_Image.php +++ b/lib/private/legacy/OC_Image.php @@ -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']); |