mirror of
https://github.com/friendica/friendica
synced 2025-04-24 01:50:17 +00:00
Improved Mime Type detection
This commit is contained in:
parent
248a7fa48a
commit
d3722c945b
9 changed files with 89 additions and 102 deletions
|
@ -4734,13 +4734,8 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
|
|||
}
|
||||
}
|
||||
|
||||
if ($filetype == "") {
|
||||
$filetype = Images::guessType($filename);
|
||||
}
|
||||
$imagedata = @getimagesize($src);
|
||||
if ($imagedata) {
|
||||
$filetype = $imagedata['mime'];
|
||||
}
|
||||
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
|
||||
|
||||
Logger::log(
|
||||
"File upload src: " . $src . " - filename: " . $filename .
|
||||
" - size: " . $filesize . " - type: " . $filetype,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue