fixes #2550 checks MIME type against each uploaded file

This commit is contained in:
plegall
2026-04-21 16:39:04 +02:00
parent d21b530cb0
commit 8cec3cc305
5 changed files with 153 additions and 33 deletions
+25
View File
@@ -3662,6 +3662,31 @@ SELECT
}
}
/**
* Displays a page warning if no MIME type is defined for an upload-authorized file extension
*
* @since 17.0.0
*/
function check_authorized_file_extension_mime_types()
{
global $conf, $page;
if (!is_webmaster())
{
return;
}
$authorized_file_extensions = $conf['upload_form_all_types'] ? $conf['file_ext'] : $conf['picture_ext'];
foreach ($authorized_file_extensions as $ext)
{
if (!isset($conf['mime_types_for_ext'][$ext]))
{
$page['warnings'][] = 'File extension "'.$ext.'" is authorized for upload but there is no $conf[\'mime_types_for_ext\'][\''.$ext.'\'] defined. Fix this.';
}
}
}
/**
* Return latest news from piwigo.org.
*