Skip to content

Commit 220a761

Browse files
authored
Merge pull request #1453 from nowackipawel/patch-19
BugFix if there extension has only one mime type (string)
2 parents 998b020 + f39c10a commit 220a761

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

application/Config/Mimes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public static function guessExtensionFromType(string $type, ?string $proposed_ex
313313

314314
$proposed_extension = trim(strtolower($proposed_extension));
315315

316-
if(!is_null($proposed_extension) && array_key_exists($proposed_extension, self::$mimes) && in_array($type, self::$mimes[$proposed_extension]))
316+
if(!is_null($proposed_extension) && array_key_exists($proposed_extension, self::$mimes) && in_array($type, is_string(self::$mimes[$proposed_extension])?[self::$mimes[$proposed_extension]]:self::$mimes[$proposed_extension]))
317317
{
318318
return $proposed_extension;
319319
}

0 commit comments

Comments
 (0)