Limit subjects for filenames to 200 characters to avoid failures

This commit is contained in:
nathangray 2018-06-04 10:24:15 -06:00
parent ec9bbf28d3
commit 5d65420a03

View File

@ -6448,7 +6448,7 @@ class Mail
static function clean_subject_for_filename($filename)
{
static $filter_pattern = '$[\f\n\t\x0b\:*#?<>%"\|/\x{10000}-\x{10FFFF}\\\\]$u';
$file = trim(preg_replace($filter_pattern, ' ', $filename));
$file = substr(trim(preg_replace($filter_pattern, ' ', $filename)), 0, 200);
if (empty($file)) $file = lang('empty');
return $file;
}