mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
fix some issues for file upload type validation
This commit is contained in:
parent
c53943aa76
commit
74ec0f6651
@ -119,11 +119,12 @@ class etemplate_widget_file extends etemplate_widget
|
|||||||
{
|
{
|
||||||
$type = $file['type'];
|
$type = $file['type'];
|
||||||
$is_preg = $mime[0] == '/';
|
$is_preg = $mime[0] == '/';
|
||||||
if (!$is_preg && strcasecmp($mime[0],$type) ||
|
if (!$is_preg && strcasecmp($mime,$type) ||
|
||||||
$is_preg && !preg_match($mime,$type))
|
$is_preg && !preg_match($mime,$type))
|
||||||
{
|
{
|
||||||
$file_data[$file['name']] = lang('File is of wrong type (%1 != %2)!',$type,$mime);
|
$file_data[$file['name']] = $file['name'].':'.lang('File is of wrong type (%1 != %2)!',$type,$mime);
|
||||||
continue;
|
//error_log(__METHOD__.__LINE__.array2string($file_data[$file['name']]));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_dir($GLOBALS['egw_info']['server']['temp_dir']) && is_writable($GLOBALS['egw_info']['server']['temp_dir']))
|
if (is_dir($GLOBALS['egw_info']['server']['temp_dir']) && is_writable($GLOBALS['egw_info']['server']['temp_dir']))
|
||||||
|
Loading…
Reference in New Issue
Block a user