mirror of
https://github.com/pelican-dev/panel.git
synced 2026-07-15 21:48:08 +03:00
Make sure plugin name doesn't contain path when importing (#2356)
This commit is contained in:
@@ -260,7 +260,7 @@ class PluginResource extends Resource
|
||||
/** @var UploadedFile $file */
|
||||
$file = $data['file'];
|
||||
|
||||
$pluginName = str($file->getClientOriginalName())->before('.zip')->toString();
|
||||
$pluginName = str($file->getClientOriginalName())->basename()->before('.zip')->toString();
|
||||
|
||||
if (Plugin::where('id', $pluginName)->exists()) {
|
||||
throw new Exception(trans('admin/plugin.notifications.import_exists'));
|
||||
|
||||
@@ -377,7 +377,7 @@ class PluginService
|
||||
}
|
||||
}
|
||||
|
||||
$pluginName = str($file->getClientOriginalName())->before('.zip')->toString();
|
||||
$pluginName = str($file->getClientOriginalName())->basename()->before('.zip')->toString();
|
||||
|
||||
if ($cleanDownload) {
|
||||
File::deleteDirectory(plugin_path($pluginName));
|
||||
|
||||
Reference in New Issue
Block a user