From f0ad0b35dc59ed96af7dbe644ec96acf95f92d38 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 6 Apr 2020 08:30:09 +0700 Subject: [PATCH] /u regex suffix rename test --- system/Autoloader/Autoloader.php | 2 +- tests/system/Autoloader/AutoloaderTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/Autoloader/Autoloader.php b/system/Autoloader/Autoloader.php index 0b6352639382..47bb31c20630 100644 --- a/system/Autoloader/Autoloader.php +++ b/system/Autoloader/Autoloader.php @@ -392,7 +392,7 @@ public function sanitizeFilename(string $filename): string // be a path. // http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_278 // Modified to allow backslash and colons for on Windows machines. - $filename = preg_replace('/[^a-zA-Z0-9\p{L}\s\/\-\_\.\:\\\\]/', '', $filename); + $filename = preg_replace('/[^a-zA-Z0-9\p{L}\s\/\-\_\.\:\\\\]/u', '', $filename); // Clean up our filename edges. $filename = trim($filename, '.-_'); diff --git a/tests/system/Autoloader/AutoloaderTest.php b/tests/system/Autoloader/AutoloaderTest.php index 16404dfb9495..5671e8e9a379 100644 --- a/tests/system/Autoloader/AutoloaderTest.php +++ b/tests/system/Autoloader/AutoloaderTest.php @@ -211,7 +211,7 @@ public function testSanitizationSimply() //-------------------------------------------------------------------- - public function testSanitizationAllowSomeUnicodeChars() + public function testSanitizationAllowUnicodeChars() { $test = 'Ä/path/to/some/file.php_'; $expected = 'Ä/path/to/some/file.php';