From f6f6d04283d577bb84478334c550cde82bb1873f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 8 Jan 2019 11:16:24 +0100 Subject: [PATCH] Apply suggestions from code review Use explicit comparison See #2825 Co-Authored-By: joshuaruesweg --- .../install/files/lib/action/AJAXFileUploadAction.class.php | 2 +- .../files/lib/system/file/upload/UploadHandler.class.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/action/AJAXFileUploadAction.class.php b/wcfsetup/install/files/lib/action/AJAXFileUploadAction.class.php index b43a9caa92..d827cc0ed6 100644 --- a/wcfsetup/install/files/lib/action/AJAXFileUploadAction.class.php +++ b/wcfsetup/install/files/lib/action/AJAXFileUploadAction.class.php @@ -121,7 +121,7 @@ class AJAXFileUploadAction extends AbstractSecureAction { 'filename' => $file->getFilename(), 'icon' => $file->getIconName(), 'filesize' => FileUtil::formatFilesize($file->filesize), - 'image' => ($file->viewableImage) ? $file->getImage() : null, + 'image' => $file->viewableImage ? $file->getImage() : null, 'uniqueFileId' => $file->getUniqueFileId() ]; } diff --git a/wcfsetup/install/files/lib/system/file/upload/UploadHandler.class.php b/wcfsetup/install/files/lib/system/file/upload/UploadHandler.class.php index 9dafd645ab..2515b11847 100644 --- a/wcfsetup/install/files/lib/system/file/upload/UploadHandler.class.php +++ b/wcfsetup/install/files/lib/system/file/upload/UploadHandler.class.php @@ -137,7 +137,7 @@ class UploadHandler extends SingletonFactory { /** @var UploadFile $storageFile */ foreach ($storage[$internalId]['files'] as $id => $storageFile) { - if ($storageFile->getUniqueFileId() == $uniqueFileId) { + if ($storageFile->getUniqueFileId() === $uniqueFileId) { unset($storage[$internalId]['files'][$id]); break; } @@ -195,7 +195,7 @@ class UploadHandler extends SingletonFactory { } foreach ($this->getFilesForInternalId($internalId) as $file) { - if ($file->getUniqueFileId() == $uniqueFileId) { + if ($file->getUniqueFileId() === $uniqueFileId) { return $file; } } -- 2.20.1