Alternative fix to #3607

Fixes #3607
Fixes #3606
This commit is contained in:
Samuel Georges 2018-06-29 14:20:55 +10:00
parent 8b650e3bd0
commit 000a880742
2 changed files with 2 additions and 2 deletions

View File

@ -1205,7 +1205,7 @@ class MediaManager extends WidgetBase
*/
protected function validateFileName($name)
{
if (!preg_match('/^[0-9a-z@\.\s_\-]+$/i', $name)) {
if (!preg_match('/^[\w@\.\s_\-]+$/iu', $name)) {
return false;
}

View File

@ -475,7 +475,7 @@ class MediaLibrary
/*
* Validate folder names
*/
if (!preg_match('/^[0-9a-z@\.\s_\-\/]+$/i', $path)) {
if (!preg_match('/^[\w@\.\s_\-\/]+$/iu', $path)) {
throw new ApplicationException(Lang::get('system::lang.media.invalid_path', compact('path')));
}