更新正则表达式

排除更多非法字符
This commit is contained in:
Chenx221 2024-02-12 14:03:10 +08:00
parent eefae10afe
commit ed463be4f1
Signed by: chenx221
GPG Key ID: D7A9EC07024C3021

View File

@ -14,7 +14,7 @@ class RenameForm extends Model
return [
['newName', 'required'],
['newName', 'string', 'max' => 255],
['newName', 'match', 'pattern' => '/^[^\/:*?"<>|\\\\]+$/', 'message' => 'Invalid file name.'],
['newName', 'match', 'pattern' => '/^[^\p{C}\/:*?"<>|\\\\]+$/u', 'message' => 'Invalid file name.'],
];
}
}