aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-10-30 17:26:32 +0000
committerCash Costello <cash.costello@gmail.com>2010-10-30 17:26:32 +0000
commit43c7b8c642a5fc8541122414849a75770975b222 (patch)
treeb093542d2af686565262884aceec9658f7645c7d /lib
parent6cc8f7714561a681428c2d402b15666e8e0af0fd (diff)
downloadelgg-43c7b8c642a5fc8541122414849a75770975b222.tar.gz
elgg-43c7b8c642a5fc8541122414849a75770975b222.tar.bz2
handling errors in ajax upload
Diffstat (limited to 'lib')
-rw-r--r--lib/upload.php7
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;
}
}