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
2022-11-05 10:45:08 +01:00
committed by Pierrick Le Gall
parent c88ca1ed0f
commit 7ecf80d4e9

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);