Skip to content

Commit

Permalink
Merge pull request #4186 from MGatner/stl
Browse files Browse the repository at this point in the history
Add STL mime support
  • Loading branch information
MGatner authored Jan 29, 2021
2 parents e8a7926 + 46b8f83 commit a2de32f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/Config/Mimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ class Mimes
'image/x-ico',
'image/vnd.microsoft.icon',
],
'stl' => [
'application/sla',
'application/vnd.ms-pki.stl',
'application/x-navistyle',
],
];

/**
Expand Down Expand Up @@ -511,7 +516,7 @@ public static function guessExtensionFromType(string $type, string $proposedExte

if ($proposedExtension !== '')
{
if(array_key_exists($proposedExtension, static::$mimes) && in_array($type, is_string(static::$mimes[$proposedExtension]) ? [static::$mimes[$proposedExtension]] : static::$mimes[$proposedExtension], true))
if (array_key_exists($proposedExtension, static::$mimes) && in_array($type, is_string(static::$mimes[$proposedExtension]) ? [static::$mimes[$proposedExtension]] : static::$mimes[$proposedExtension], true))
{
// The detected mime type matches with the proposed extension.
return $proposedExtension;
Expand Down

0 comments on commit a2de32f

Please sign in to comment.