Update extensions.php

Updated the regex pattern to allow any Unicode character in the filename.
This commit is contained in:
Shane Cooke 2024-08-19 15:31:52 +02:00 committed by GitHub
parent 5a2600209f
commit 6a813aa63e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -223,12 +223,14 @@ function GetUserDisplayName($user)
function IsValidFileName($fileName) function IsValidFileName($fileName)
{ {
if (preg_match('=^[^/?*;:{}\\\\]+\.[^/?*;:{}\\\\]+$=', $fileName)) // Pattern allows any Unicode character except '/', '?', '*', ':', ';', '{', '}', '\'
{ $pattern = '/^[^\x00-\x1F\/?:*;"{}\\\]+(\.[^\x00-\x1F\/?:*;"{}\\\]+)?$/u';
return true;
} if (preg_match($pattern, $fileName)) {
return true;
}
return false; return false;
} }
function IsJsonString($text) function IsJsonString($text)