[ticket/11912] Check if content_guesser is supported with function_exists

PHPBB3-11912
This commit is contained in:
Marc Alexander 2013-11-23 00:51:29 +01:00
parent df6e03266f
commit e108418824

View file

@ -20,17 +20,14 @@ class content_guesser extends guesser_base
*/ */
public function is_supported() public function is_supported()
{ {
return true; return function_exists('mime_content_type');
} }
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function guess($file, $file_name = '') public function guess($file, $file_name = '')
{
if (function_exists('mime_content_type'))
{ {
return mime_content_type($file); return mime_content_type($file);
} }
} }
}