mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
fixing function and test
This commit is contained in:
parent
b831af967e
commit
0bac07f1ba
@ -6447,7 +6447,7 @@ class Mail
|
||||
*/
|
||||
static function clean_subject_for_filename($filename)
|
||||
{
|
||||
static $filter_pattern = '$[\f\n\t\x0b\:*#?<>%"\|/\x{10000}-\x{10FFFF}]$u';
|
||||
static $filter_pattern = '$[\f\n\t\x0b\:*#?<>%"\|/\x{10000}-\x{10FFFF}\\\\]$u';
|
||||
$file = trim(preg_replace($filter_pattern, ' ', $filename));
|
||||
if (empty($file)) $file = lang('empty');
|
||||
return $file;
|
||||
|
@ -13,11 +13,7 @@
|
||||
|
||||
namespace EGroupware\Mail;
|
||||
|
||||
require_once realpath(__DIR__.'/../../api/tests/AppTest.php'); // Application test base
|
||||
|
||||
use Egroupware\Api;
|
||||
|
||||
class SaveToVfsTest extends \EGroupware\Api\AppTest
|
||||
class SaveToVfsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* Create a custom status we can use to test
|
||||
@ -69,7 +65,7 @@ class SaveToVfsTest extends \EGroupware\Api\AppTest
|
||||
$this->assertNotContains('😂', $cleaned);
|
||||
|
||||
// Check if the filename is not empty
|
||||
$this->assertGreaterThan(0, strlen($filename), 'File name is empty');
|
||||
$this->assertGreaterThan(0, strlen($cleaned), 'File name is empty');
|
||||
|
||||
if(!$replacements)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user