From 5d65420a0346f762efdfefe047da02d35593cf69 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 4 Jun 2018 10:24:15 -0600 Subject: [PATCH] Limit subjects for filenames to 200 characters to avoid failures --- api/src/Mail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Mail.php b/api/src/Mail.php index 2860d3cecb..5f2cd94a84 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -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; }