X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fattach.php;h=4001d2af1351bd7f92714ad3263357365b3eee46;hb=c4179d989fcce35dc174c00dedb1cde1930d744d;hp=ca53081d9347ea764909a9445f0632fa820a539e;hpb=73b4faca5c7af506558eba6b7317d23551f1aefa;p=friendica.git diff --git a/include/attach.php b/include/attach.php index ca53081d93..4001d2af13 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1,7 +1,7 @@ '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'; } -}} +}