mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Fixes folder creation and rename in asset list
This commit is contained in:
parent
9df40c07b8
commit
27062ddfa0
@ -221,13 +221,6 @@ class AssetList extends WidgetBase
|
||||
throw new ApplicationException(Lang::get('cms::lang.asset.invalid_name'));
|
||||
}
|
||||
|
||||
if (!$this->validateFileType($newName)) {
|
||||
throw new ApplicationException(Lang::get(
|
||||
'cms::lang.asset.type_not_allowed',
|
||||
['allowed_types' => implode(', ', $this->assetExtensions)]
|
||||
));
|
||||
}
|
||||
|
||||
$originalPath = Input::get('originalPath');
|
||||
if (!$this->validatePath($originalPath)) {
|
||||
throw new ApplicationException(Lang::get('cms::lang.asset.invalid_path'));
|
||||
@ -238,6 +231,13 @@ class AssetList extends WidgetBase
|
||||
throw new ApplicationException(Lang::get('cms::lang.asset.original_not_found'));
|
||||
}
|
||||
|
||||
if (!is_dir($originalFullPath) && !$this->validateFileType($newName)) {
|
||||
throw new ApplicationException(Lang::get(
|
||||
'cms::lang.asset.type_not_allowed',
|
||||
['allowed_types' => implode(', ', $this->assetExtensions)]
|
||||
));
|
||||
}
|
||||
|
||||
$newFullPath = $this->getFullPath(dirname($originalPath).'/'.$newName);
|
||||
if (file_exists($newFullPath) && $newFullPath !== $originalFullPath) {
|
||||
throw new ApplicationException(Lang::get('cms::lang.asset.already_exists'));
|
||||
@ -276,13 +276,6 @@ class AssetList extends WidgetBase
|
||||
throw new ApplicationException(Lang::get('cms::lang.asset.invalid_name'));
|
||||
}
|
||||
|
||||
if (!$this->validateFileType($newName)) {
|
||||
throw new ApplicationException(Lang::get(
|
||||
'cms::lang.asset.type_not_allowed',
|
||||
['allowed_types' => implode(', ', $this->assetExtensions)]
|
||||
));
|
||||
}
|
||||
|
||||
$newFullPath = $this->getCurrentPath().'/'.$newName;
|
||||
if (file_exists($newFullPath)) {
|
||||
throw new ApplicationException(Lang::get('cms::lang.asset.already_exists'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user