Fix: Not reflecting "defaultMask" when uploading file@CMS (#4698)

When uploading file through "CMS"->"Files"->"Add" -> "Upload file(s)", uploaded file doesn't have set file permissions according to "cms.defaultMask.file" from Config.

This patch fixes it so "defaultMask" can be different from umask and file has correctly set its permissions (usefull when required permissions are other than "644") as well as it has files/directories directly created in CMS section.
This commit is contained in:
Kmarty 2020-03-29 17:27:23 +02:00 committed by GitHub
parent 1aa3250c3a
commit 8c0598cc4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -662,7 +662,9 @@ class AssetList extends WidgetBase
/*
* Accept the uploaded file
*/
$uploadedFile->move($this->getCurrentPath(), $uploadedFile->getClientOriginalName());
$uploadedFile = $uploadedFile->move($this->getCurrentPath(), $uploadedFile->getClientOriginalName());
File::chmod($uploadedFile->getRealPath());
$response = Response::make('success');
}