mirror of
https://github.com/friendica/friendica
synced 2024-11-19 14:23:42 +00:00
Ops, forgot to rename these, too.
This commit is contained in:
parent
abd0d9f3fd
commit
08f55f0358
1 changed files with 4 additions and 4 deletions
|
@ -140,14 +140,14 @@ class Images
|
||||||
*/
|
*/
|
||||||
public static function getMimeTypeBySource(string $sourcefile, string $filename = '', string $default = ''): string
|
public static function getMimeTypeBySource(string $sourcefile, string $filename = '', string $default = ''): string
|
||||||
{
|
{
|
||||||
if (substr($mime, 0, 6) == 'image/') {
|
if (substr($default, 0, 6) == 'image/') {
|
||||||
Logger::info('Using default mime type', ['filename' => $filename, 'mime' => $mime]);
|
Logger::info('Using default mime type', ['filename' => $filename, 'mime' => $default]);
|
||||||
return $mime;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
$image = @getimagesize($sourcefile);
|
$image = @getimagesize($sourcefile);
|
||||||
if (!empty($image['mime'])) {
|
if (!empty($image['mime'])) {
|
||||||
Logger::info('Mime type detected via file', ['filename' => $filename, 'default' => $mime, 'image' => $image]);
|
Logger::info('Mime type detected via file', ['filename' => $filename, 'default' => $default, 'image' => $image]);
|
||||||
return $image['mime'];
|
return $image['mime'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue