]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed minor issue with uploading png from IE7
authorCash Costello <cash.costello@gmail.com>
Sun, 7 Jun 2009 00:20:23 +0000 (00:20 +0000)
committerCash Costello <cash.costello@gmail.com>
Sun, 7 Jun 2009 00:20:23 +0000 (00:20 +0000)
actions/upload.php
lib/resize.php

index 8f84ea92942ecd693bbcfd190045fd41899d100d..da8af6e699e5941a9514ccfe479121eae3b35870 100644 (file)
        $error_msgs = array();\r
        \r
        $river_view = get_plugin_setting('river_view', 'tidypics');\r
+       \r
+       $accepted_formats = array(\r
+                                                               'image/jpeg',\r
+                                                               'image/png',\r
+                                                               'image/gif',\r
+                                                               'image/pjpeg',\r
+                                                               'image/x-png',\r
+                                                               );\r
+\r
 \r
        foreach($_FILES as $key => $sent_file) {\r
                \r
@@ -58,7 +67,7 @@
                \r
                $name = $sent_file['name'];\r
                $mime = $sent_file['type'];\r
-               \r
+\r
                if ($sent_file['error']) {\r
                        array_push($not_uploaded, $sent_file['name']);\r
                        if ($sent_file['error'] == 1) {\r
@@ -72,7 +81,7 @@
                }\r
                \r
                //make sure file is an image\r
-               if ($mime != 'image/jpeg' && $mime != 'image/gif' && $mime != 'image/png' && $mime != 'image/pjpeg') {\r
+               if (!in_array($mime, $accepted_formats)) {\r
                        array_push($not_uploaded, $sent_file['name']);\r
                        array_push($error_msgs, elgg_echo('tidypics:not_image'));\r
                        continue;\r
index e3facf614b170d3c71d27b08bc59546d1edf87b1..974f32e9e2d7e17ae256d4a1eedbc217df6a9a58 100644 (file)
                if (!$imgsizearray)\r
                        return false;\r
                \r
-               $accepted_formats = array(\r
-                                                                               'image/jpeg' => 'jpeg',\r
-                                                                               'image/png' => 'png',\r
-                                                                               'image/gif' => 'gif'\r
-                                                               );\r
-               \r
-               // test if it's a file we can manipulate ...\r
-               if (!array_key_exists($imgsizearray['mime'],$accepted_formats))\r
-                       return false;\r
 \r
                // Get width and height\r
                $width = $imgsizearray[0];\r