diff options
| author | Tristan Darricau <github@nicofuma.fr> | 2014-09-06 13:53:43 +0200 |
|---|---|---|
| committer | Tristan Darricau <github@nicofuma.fr> | 2014-09-06 13:53:43 +0200 |
| commit | 6387bf8d1399b9ccf995b8eb5a4b93425d27e873 (patch) | |
| tree | eebf5374ee0f46ee5ddebc92f9847613ba87e27e /phpBB/includes | |
| parent | 6eaeae60f6a2602cb44b1aa596af794629828313 (diff) | |
| parent | 21029e9fd295bedfcc34555d32afd928a03392a1 (diff) | |
| download | forums-6387bf8d1399b9ccf995b8eb5a4b93425d27e873.tar forums-6387bf8d1399b9ccf995b8eb5a4b93425d27e873.tar.gz forums-6387bf8d1399b9ccf995b8eb5a4b93425d27e873.tar.bz2 forums-6387bf8d1399b9ccf995b8eb5a4b93425d27e873.tar.xz forums-6387bf8d1399b9ccf995b8eb5a4b93425d27e873.zip | |
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
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/functions_upload.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index a0a67ccf3d..f179b2fd70 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -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; |
