mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 16:29:52 +01:00
remove 4-byte unicode when cleaning subjects
This commit is contained in:
parent
d647c197a7
commit
c795f13f81
@ -6438,13 +6438,19 @@ class Mail
|
|||||||
* Under Windows the characters < > ? " : | \ / * are not allowed.
|
* Under Windows the characters < > ? " : | \ / * are not allowed.
|
||||||
* % causes problems with VFS UI
|
* % causes problems with VFS UI
|
||||||
*
|
*
|
||||||
|
* 4-byte unicode is also unwanted, as our current MySQL collation can store it
|
||||||
|
*
|
||||||
|
* We also dont want empty filenames, using lang('empty') instead.
|
||||||
|
*
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
* @return Cleaned filename, with problematic characters replaced with '_'.
|
* @return Cleaned filename, with problematic characters replaced with ' '.
|
||||||
*/
|
*/
|
||||||
static function clean_subject_for_filename($filename)
|
static function clean_subject_for_filename($filename)
|
||||||
{
|
{
|
||||||
static $filter_pattern = '$[\f\n\t\x0b\:*#?<>%"\|/\\\?]$';
|
static $filter_pattern = '$[\f\n\t\x0b\:*#?<>%"\|/\x{10000}-\x{10FFFF}]$u';
|
||||||
return preg_replace($filter_pattern, "_", trim($filename));
|
$file = trim(preg_replace($filter_pattern, ' ', $filename));
|
||||||
|
if (empty($file)) $file = lang('empty');
|
||||||
|
return $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user