diff options
author | Cash Costello <cash.costello@gmail.com> | 2010-10-30 17:26:32 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2010-10-30 17:26:32 +0000 |
commit | 43c7b8c642a5fc8541122414849a75770975b222 (patch) | |
tree | b093542d2af686565262884aceec9658f7645c7d /lib | |
parent | 6cc8f7714561a681428c2d402b15666e8e0af0fd (diff) | |
download | elgg-43c7b8c642a5fc8541122414849a75770975b222.tar.gz elgg-43c7b8c642a5fc8541122414849a75770975b222.tar.bz2 |
handling errors in ajax upload
Diffstat (limited to 'lib')
-rw-r--r-- | lib/upload.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/upload.php b/lib/upload.php index ac926403d..30540dced 100644 --- a/lib/upload.php +++ b/lib/upload.php @@ -11,7 +11,7 @@ */ function tp_upload_get_mimetype($originalName) { $extension = substr(strrchr($originalName, '.'), 1); - switch ($extension) { + switch (strtolower($extension)) { case 'png': return 'image/png'; break; @@ -19,9 +19,12 @@ function tp_upload_get_mimetype($originalName) { return 'image/gif'; break; case 'jpg': - default: + case 'jpeg': return 'image/jpeg'; break; + default: + return 'unknown'; + break; } } |