mirror of
https://github.com/grocy/grocy.git
synced 2026-03-28 07:39:25 +01:00
Update extensions.php
Updated the regex pattern to allow any Unicode character in the filename.
This commit is contained in:
parent
5a2600209f
commit
6a813aa63e
|
|
@ -223,12 +223,14 @@ function GetUserDisplayName($user)
|
|||
|
||||
function IsValidFileName($fileName)
|
||||
{
|
||||
if (preg_match('=^[^/?*;:{}\\\\]+\.[^/?*;:{}\\\\]+$=', $fileName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Pattern allows any Unicode character except '/', '?', '*', ':', ';', '{', '}', '\'
|
||||
$pattern = '/^[^\x00-\x1F\/?:*;"{}\\\]+(\.[^\x00-\x1F\/?:*;"{}\\\]+)?$/u';
|
||||
|
||||
if (preg_match($pattern, $fileName)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function IsJsonString($text)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user