aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/mimetype/guesser.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-10-24 12:05:00 +0200
committerMarc Alexander <admin@m-a-styles.de>2013-10-24 12:05:00 +0200
commitbc7ff47537bae4f6db9de781cf8ba3487e28a30b (patch)
tree8cb137952d6b138c19e63f435c462cd93e091e5b /phpBB/phpbb/mimetype/guesser.php
parent24099583a32608c2350bdb10d018d6c8a0551e6c (diff)
downloadforums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.tar
forums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.tar.gz
forums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.tar.bz2
forums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.tar.xz
forums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.zip
[ticket/11912] Supply filename to content_guesser for guessing on windows
The filename of the files sent to the guesser by plupload do not contain the file extension. Therefore, it's impossible to guess the mimetype if only the content_guesser is available and the function mime_content_type() doesn't exist. By supplying the filename we can circumvent this issue. PHPBB3-11912
Diffstat (limited to 'phpBB/phpbb/mimetype/guesser.php')
-rw-r--r--phpBB/phpbb/mimetype/guesser.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/phpbb/mimetype/guesser.php b/phpBB/phpbb/mimetype/guesser.php
index 5ae094cd63..231b75f604 100644
--- a/phpBB/phpbb/mimetype/guesser.php
+++ b/phpBB/phpbb/mimetype/guesser.php
@@ -77,7 +77,7 @@ class guesser
*
* @return string Guess for mimetype of file
*/
- public function guess($file)
+ public function guess($file, $file_name = '')
{
if (!is_file($file))
{
@@ -91,7 +91,7 @@ class guesser
foreach ($this->guessers as $guesser)
{
- $mimetype = $guesser->guess($file);
+ $mimetype = $guesser->guess($file, $file_name);
// Try to guess something that is not the fallback application/octet-stream
if ($mimetype !== null && $mimetype !== 'application/octet-stream')