mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
Merge pull request #46569 from nextcloud/backport/46342/stable29
[stable29] fix(previews): Stop returning true when `getimagesize()` fails
This commit is contained in:
commit
ec016b0a64
1 changed files with 3 additions and 3 deletions
|
|
@ -626,7 +626,7 @@ class OC_Image implements \OCP\IImage {
|
|||
private function checkImageSize($path) {
|
||||
$size = @getimagesize($path);
|
||||
if (!$size) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$width = $size[0];
|
||||
|
|
@ -647,7 +647,7 @@ class OC_Image implements \OCP\IImage {
|
|||
private function checkImageDataSize($data) {
|
||||
$size = @getimagesizefromstring($data);
|
||||
if (!$size) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$width = $size[0];
|
||||
|
|
@ -694,7 +694,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']);
|
||||
|
|
|
|||
Loading…
Reference in a new issue