mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +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
2febc0a46e
commit
e13bd2ed63
@ -6394,6 +6394,25 @@ class Mail
|
|||||||
return $headdata;
|
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
|
* adaptSubjectForImport - strips subject from unwanted Characters, and does some normalization
|
||||||
* to meet expectations
|
* to meet expectations
|
||||||
|
Loading…
Reference in New Issue
Block a user