Check function_exists('mime_content_type') before calling

mime_content_type() is in the fileinfo extension that may not be
installed or configured. It's also checked in action.php

See https://piwigo.org/forum/viewtopic.php?id=32327
This commit is contained in:
Eike Rathke authored and Pierrick Le Gall committed 2023-08-08 10:43:58 +02:00
1 parent c88ca1ed0f
commit 7ecf80d4e9
1 file changed
+1 -1
+1 -1
View File
@@ -182,7 +182,7 @@ function get_sync_metadata($infos)
$file = original_to_representative($file, $infos['representative_ext']);
}
if (in_array(mime_content_type($file), array('image/svg+xml', 'image/svg')))
if (function_exists('mime_content_type') && in_array(mime_content_type($file), array('image/svg+xml', 'image/svg')))
{
$xml = file_get_contents($file);