Fix validation of style preview image type
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 6 Jun 2016 15:27:12 +0000 (17:27 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 6 Jun 2016 15:27:12 +0000 (17:27 +0200)
wcfsetup/install/files/lib/data/style/StyleAction.class.php
wcfsetup/install/files/lib/data/style/StyleEditor.class.php

index 1072cfa96a1d1725b763caecc9ebaf64cf34d256..fe97835a4623531f4a9e8a66a60d762b650c7996 100644 (file)
@@ -286,10 +286,10 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction
                                                throw new UserInputException('image');
                                        }
                                        switch ($imageData[2]) {
-                                               case IMG_PNG:
-                                               case IMG_JPEG:
-                                               case IMG_JPG:
-                                               case IMG_GIF:
+                                               case IMAGETYPE_PNG:
+                                               case IMAGETYPE_JPEG:
+                                               case IMAGETYPE_JPG:
+                                               case IMAGETYPE_GIF:
                                                        // fine
                                                break;
                                                default:
index 662484969effaf5379200410d1efdcccd1b2b8a8..0eb73fb2bb4dbb94ea69776620fc5e4667757f2e 100644 (file)
@@ -471,10 +471,10 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                                        try {
                                                if (($imageData = getimagesize($filename)) !== false) {
                                                        switch ($imageData[2]) {
-                                                               case IMG_PNG:
-                                                               case IMG_JPEG:
-                                                               case IMG_JPG:
-                                                               case IMG_GIF:
+                                                               case IMAGETYPE_PNG:
+                                                               case IMAGETYPE_JPEG:
+                                                               case IMAGETYPE_JPG:
+                                                               case IMAGETYPE_GIF:
                                                                        $style->update(array('image' => 'stylePreview-'.$style->styleID.$fileExtension));
                                                        }
                                                }