Make sure plugin name doesn't contain path when importing (#2356)

This commit is contained in:
Boy132
2026-05-26 13:54:30 +02:00
committed by GitHub
parent 447a8c1ff7
commit 13bb47e6eb
2 changed files with 2 additions and 2 deletions

View File

@@ -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'));

View File

@@ -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));