From ba462d1e93bafbbd025df6c43230aa2e960139f1 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 8 May 2023 12:41:32 -0700 Subject: [PATCH] Check that the filename we pass ends in zip, add it if not Signed-off-by: snipe --- app/Console/Commands/SystemBackup.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/SystemBackup.php b/app/Console/Commands/SystemBackup.php index 09f23dd887..3b51bcc736 100644 --- a/app/Console/Commands/SystemBackup.php +++ b/app/Console/Commands/SystemBackup.php @@ -38,7 +38,14 @@ class SystemBackup extends Command public function handle() { if ($this->option('filename')) { - $this->call('backup:run', ['--filename' => $this->option('filename')]); + $filename = $this->option('filename'); + + // Make sure the filename ends in .zip + if (!ends_with($filename, '.zip')) { + $filename = $filename.'.zip'; + } + + $this->call('backup:run', ['--filename' => $filename]); } else { $this->call('backup:run'); }