mirror of
https://github.com/friendica/friendica
synced 2025-04-19 05:50:10 +00:00
several fixes for attachments
This commit is contained in:
parent
d0b7723bbc
commit
ad1e827169
6 changed files with 24 additions and 14 deletions
|
@ -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';
|
||||
}
|
||||
}}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue