Simplify code
authorJoshua Rüsweg <josh@bastelstu.be>
Thu, 10 Jan 2019 13:39:57 +0000 (14:39 +0100)
committerJoshua Rüsweg <josh@bastelstu.be>
Thu, 10 Jan 2019 13:39:57 +0000 (14:39 +0100)
See #2825

wcfsetup/install/files/lib/system/file/upload/UploadFile.class.php

index e32f155bf752447cadf3619a865d98e22ab6e788..e0fdb1f0c4d51adafd034f2820a156c12d0d4a34 100644 (file)
@@ -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));
                }
        }