Fixed image proxy
authorAlexander Ebert <ebert@woltlab.com>
Tue, 16 Aug 2016 18:20:24 +0000 (20:20 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 16 Aug 2016 18:20:34 +0000 (20:20 +0200)
wcfsetup/install/files/lib/action/ImageProxyAction.class.php

index 0c2bd92a0681ca0900e62be56df764906b156be3..e7c43e541d7d4a67942b0ae48f0c040e1b4ee94e 100644 (file)
@@ -48,7 +48,6 @@ class ImageProxyAction extends AbstractAction {
                        // prepare path
                        $fileExtension = pathinfo($url, PATHINFO_EXTENSION);
                        $fileLocation = WCF_DIR.'images/proxy/'.substr($fileName, 0, 2).'/'.$fileName.($fileExtension ? '.'.$fileExtension : '');
-                       $imageData = getimagesize($fileLocation);
                        $dir = dirname($fileLocation);
                        if (!@file_exists($dir)) {
                                FileUtil::makePath($dir);
@@ -77,6 +76,9 @@ class ImageProxyAction extends AbstractAction {
                                // update mtime for correct expiration calculation
                                @touch($fileLocation);
                        }
+                       else {
+                               $imageData = getimagesize($fileLocation);
+                       }
                        $this->executed();
                        
                        @header('Content-Type: '.$imageData['mime']);