aboutsummaryrefslogtreecommitdiff
path: root/actions/upload.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-06-07 00:20:23 +0000
committerCash Costello <cash.costello@gmail.com>2009-06-07 00:20:23 +0000
commit23b24f6adb289b6a7c1fe475c4068f2f99130ce7 (patch)
tree24126dec01fa0fc9c7f6724050bb8ea6a3e912d9 /actions/upload.php
parent39f644c75a545249a2cdaa490b5beb58795529a3 (diff)
downloadelgg-23b24f6adb289b6a7c1fe475c4068f2f99130ce7.tar.gz
elgg-23b24f6adb289b6a7c1fe475c4068f2f99130ce7.tar.bz2
fixed minor issue with uploading png from IE7
Diffstat (limited to 'actions/upload.php')
-rw-r--r--actions/upload.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/actions/upload.php b/actions/upload.php
index 8f84ea929..da8af6e69 100644
--- a/actions/upload.php
+++ b/actions/upload.php
@@ -49,6 +49,15 @@
$error_msgs = array();
$river_view = get_plugin_setting('river_view', 'tidypics');
+
+ $accepted_formats = array(
+ 'image/jpeg',
+ 'image/png',
+ 'image/gif',
+ 'image/pjpeg',
+ 'image/x-png',
+ );
+
foreach($_FILES as $key => $sent_file) {
@@ -58,7 +67,7 @@
$name = $sent_file['name'];
$mime = $sent_file['type'];
-
+
if ($sent_file['error']) {
array_push($not_uploaded, $sent_file['name']);
if ($sent_file['error'] == 1) {
@@ -72,7 +81,7 @@
}
//make sure file is an image
- if ($mime != 'image/jpeg' && $mime != 'image/gif' && $mime != 'image/png' && $mime != 'image/pjpeg') {
+ if (!in_array($mime, $accepted_formats)) {
array_push($not_uploaded, $sent_file['name']);
array_push($error_msgs, elgg_echo('tidypics:not_image'));
continue;