Skip to content

Commit 4734367

Browse files
authored
fortify JoomlaSetup (hestiacp#4564)
* fortify JoomlaSetup * wups * forgot import x.x
1 parent ae48105 commit 4734367

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

web/src/app/WebApp/Installers/Joomla/JoomlaSetup.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Hestia\System\Util;
66
use Hestia\WebApp\Installers\BaseSetup as BaseSetup;
7+
use function Hestiacp\quoteshellarg\quoteshellarg;
78

89
class JoomlaSetup extends BaseSetup {
910
protected $appInfo = [
@@ -85,18 +86,18 @@ public function install(array $options = null): bool {
8586
// Initialize Joomla using the CLI
8687
$cliCmd = [
8788
"/usr/bin/php",
88-
"$installDir/installation/joomla.php",
89+
quoteshellarg("$installDir/installation/joomla.php"),
8990
"install",
90-
"--site-name=" . $siteName,
91-
"--admin-user=" . $adminUsername,
92-
"--admin-username=" . $adminUsername,
93-
"--admin-password=" . $adminPassword,
94-
"--admin-email=" . $adminEmail,
95-
"--db-user=" . $dbUser,
96-
"--db-pass=" . $dbPass,
97-
"--db-name=" . $dbName,
98-
"--db-prefix=" . Util::generate_string(5, false) . "_",
99-
"--db-host=" . $dbHost,
91+
"--site-name=" . quoteshellarg($siteName),
92+
"--admin-user=" . quoteshellarg($adminUsername),
93+
"--admin-username=" . quoteshellarg($adminUsername),
94+
"--admin-password=" . quoteshellarg($adminPassword),
95+
"--admin-email=" . quoteshellarg($adminEmail),
96+
"--db-user=" . quoteshellarg($dbUser),
97+
"--db-pass=" . quoteshellarg($dbPass),
98+
"--db-name=" . quoteshellarg($dbName),
99+
"--db-prefix=" . quoteshellarg(Util::generate_string(5, false) . "_"),
100+
"--db-host=" . quoteshellarg($dbHost),
100101
"--db-type=mysqli",
101102
];
102103

0 commit comments

Comments
 (0)