From: Joshua Rüsweg Date: Thu, 10 Jan 2019 13:39:57 +0000 (+0100) Subject: Simplify code X-Git-Tag: 5.2.0_Alpha_1~296^2~43 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fdc4b7f093eab05c8aee8c72b6d6fdcdc0159ebc;p=GitHub%2FWoltLab%2FWCF.git Simplify code See #2825 --- diff --git a/wcfsetup/install/files/lib/system/file/upload/UploadFile.class.php b/wcfsetup/install/files/lib/system/file/upload/UploadFile.class.php index e32f155bf7..e0fdb1f0c4 100644 --- a/wcfsetup/install/files/lib/system/file/upload/UploadFile.class.php +++ b/wcfsetup/install/files/lib/system/file/upload/UploadFile.class.php @@ -99,12 +99,12 @@ class UploadFile { return null; } - if (!$this->processed) { - $imageData = getimagesize($this->location); - return 'data:'. $imageData['mime'] .';base64,'.base64_encode(file_get_contents($this->location)); + if ($this->processed) { + return $this->location; } else { - return $this->location; + $imageData = getimagesize($this->location); + return 'data:'. $imageData['mime'] .';base64,'.base64_encode(file_get_contents($this->location)); } }