mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 11:13:59 +02:00
Merge pull request #2918 from marc1706/ticket/13031
[ticket/13031] Only use mimetype guesser guess if it helps us * marc1706/ticket/13031: [ticket/13031] Slightly change behavior of choose_mime_type and add unit tests [ticket/13031] Guess with all mimetype guessers and pick best guess [ticket/13031] Only use mimetype guesser guess if it helps us
This commit is contained in:
@@ -232,7 +232,12 @@ class filespec
|
||||
{
|
||||
if ($this->mimetype_guesser !== null)
|
||||
{
|
||||
$this->mimetype = $this->mimetype_guesser->guess($filename);
|
||||
$mimetype = $this->mimetype_guesser->guess($filename, $this->uploadname);
|
||||
|
||||
if ($mimetype !== 'application/octet-stream')
|
||||
{
|
||||
$this->mimetype = $mimetype;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->mimetype;
|
||||
|
Reference in New Issue
Block a user