From 4d33294951f2d6723ecd8d26a5bca46ddd67c431 Mon Sep 17 00:00:00 2001 From: Boy132 Date: Mon, 10 Nov 2025 09:11:42 +0100 Subject: [PATCH] make sure plugin name & author only contain alpha num and spaces --- app/Console/Commands/Plugin/MakePluginCommand.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/Plugin/MakePluginCommand.php b/app/Console/Commands/Plugin/MakePluginCommand.php index cd6266c09..e2c9eae13 100644 --- a/app/Console/Commands/Plugin/MakePluginCommand.php +++ b/app/Console/Commands/Plugin/MakePluginCommand.php @@ -29,7 +29,9 @@ class MakePluginCommand extends Command public function handle(): void { - $name = Str::ascii($this->option('name') ?? $this->ask('Name')); + $name = $this->option('name') ?? $this->ask('Name'); + $name = preg_replace('/[^A-Za-z0-9 ]/', '', Str::ascii($name)); + $id = Str::slug($name); if ($this->filesystem->exists(plugin_path($id))) { @@ -38,7 +40,8 @@ class MakePluginCommand extends Command return; } - $author = Str::ascii($this->option('author') ?? $this->ask('Author', cache('plugin.author'))); + $author = $this->option('author') ?? $this->ask('Author', cache('plugin.author')); + $author = preg_replace('/[^A-Za-z0-9 ]/', '', Str::ascii($author)); cache()->forever('plugin.author', $author); $namespace = Str::studly($author) . '\\' . Str::studly($name);