aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-08-17 17:35:37 +0200
committerfabrixxm <fabrix.xm@gmail.com>2011-08-17 17:35:37 +0200
commitbdf42473a0341f291cd256323d122aa80bb0cb0b (patch)
tree922a5ba24a34d7ea89673019e82f68436edb7091 /include/attach.php
parent6c423feed2d8bc5bd36d2a1cbac073915e523749 (diff)
parentdb03b1ab173d61b1ee75271dac1e48f3475ad42c (diff)
downloadvolse-hubzilla-bdf42473a0341f291cd256323d122aa80bb0cb0b.tar.gz
volse-hubzilla-bdf42473a0341f291cd256323d122aa80bb0cb0b.tar.bz2
volse-hubzilla-bdf42473a0341f291cd256323d122aa80bb0cb0b.zip
Merge remote-tracking branch 'friendika/master' into newui
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/attach.php b/include/attach.php
index ca53081d9..4001d2af1 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1,7 +1,7 @@
<?php
-if(!function_exists('mime_content_type')) {
-function mime_content_type($filename) {
+
+function z_mime_content_type($filename) {
$mime_types = array(
@@ -61,8 +61,9 @@ function mime_content_type($filename) {
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
);
- if(strpos($filename,'.') !== false) {
- $ext = strtolower(array_pop(explode('.',$filename)));
+ $dot = strpos($filename,'.');
+ if($dot !== false) {
+ $ext = strtolower(substr($filename,$dot+1));
if (array_key_exists($ext, $mime_types)) {
return $mime_types[$ext];
}
@@ -76,5 +77,5 @@ function mime_content_type($filename) {
else {
return 'application/octet-stream';
}
-}}
+}