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 9818b48bd8
commit 06fdb9c63d

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