mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 16:33:17 +01:00
Mail - Reorganize and use same cleaning function when saving mail as infolog as for saving to VFS
This commit is contained in:
parent
a084094f1d
commit
e3ad2ebdf0
@ -6394,6 +6394,25 @@ class Mail
|
||||
return $headdata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make the provided filename safe to store in the VFS
|
||||
*
|
||||
* Some characters found in subjects that cause problems if we try to put
|
||||
* them as filenames (Windows) so we remove any characters that might result
|
||||
* in additional directories, or issues on Windows.
|
||||
*
|
||||
* Under Windows the characters < > ? " : | \ / * are not allowed.
|
||||
* % causes problems with VFS UI
|
||||
*
|
||||
* @param string $filename
|
||||
* @return Cleaned filename, with problematic characters replaced with '_'.
|
||||
*/
|
||||
protected static function clean_subject_for_filename($filename)
|
||||
{
|
||||
static $filter_pattern = '$[\f\n\t\v\\:*#?<>%"\|/\\\?]$';
|
||||
return preg_replace($filter_pattern, "_", trim($filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* adaptSubjectForImport - strips subject from unwanted Characters, and does some normalization
|
||||
* to meet expectations
|
||||
|
Loading…
Reference in New Issue
Block a user