mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
Make sure replace only and only VT char (Vertical Tab)
This commit is contained in:
parent
205cf9c588
commit
63dd5ce96b
@ -6443,7 +6443,7 @@ class Mail
|
||||
*/
|
||||
static function clean_subject_for_filename($filename)
|
||||
{
|
||||
static $filter_pattern = '$[\f\n\t\v\\:*#?<>%"\|/\\\?]$';
|
||||
static $filter_pattern = '$[\f\n\t\x0b\:*#?<>%"\|/\\\?]$';
|
||||
return preg_replace($filter_pattern, "_", trim($filename));
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,7 @@ class SaveToVfsTest extends \EGroupware\Api\AppTest
|
||||
$this->assertNotContains('*', $cleaned);
|
||||
$this->assertNotContains('/', $cleaned);
|
||||
$this->assertNotContains('?', $cleaned);
|
||||
$this->assertNotContains('\x0b', $cleaned);
|
||||
|
||||
// Length should stay the same
|
||||
$this->assertEquals(strlen($filename), strlen($cleaned), 'Length changed');
|
||||
@ -94,6 +95,7 @@ class SaveToVfsTest extends \EGroupware\Api\AppTest
|
||||
array('Contains a /', true),
|
||||
array('Contains a ?', true),
|
||||
array('Contains a %', true),
|
||||
array('Contains a '.chr(11), true),
|
||||
array('This one contains them all < > " : | \ * / ? % are not allowed', true)
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user