Browse Source

fortify PrestashopSetup (#4569)

* fortify PrestashopSetup

* Run NPM format

---------

Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
divinity76 1 year ago
parent
commit
6ffb260cb0
1 changed files with 14 additions and 11 deletions
  1. 14 11
      web/src/app/WebApp/Installers/Prestashop/PrestashopSetup.php

+ 14 - 11
web/src/app/WebApp/Installers/Prestashop/PrestashopSetup.php

@@ -3,6 +3,7 @@
 namespace Hestia\WebApp\Installers\Prestashop;
 
 use Hestia\WebApp\Installers\BaseSetup as BaseSetup;
+use function Hestiacp\quoteshellarg\quoteshellarg;
 
 class PrestashopSetup extends BaseSetup {
 	protected $appInfo = [
@@ -71,17 +72,19 @@ class PrestashopSetup extends BaseSetup {
 			"v-run-cli-cmd",
 			[
 				"/usr/bin/php" . $options["php_version"],
-				$this->getDocRoot("/install/index_cli.php"),
-				"--db_server=" . $options["database_host"],
-				"--db_user=" . $this->appcontext->user() . "_" . $options["database_user"],
-				"--db_password=" . $options["database_password"],
-				"--db_name=" . $this->appcontext->user() . "_" . $options["database_name"],
-				"--firstname=" . $options["prestashop_account_first_name"],
-				"--lastname=" . $options["prestashop_account_last_name"],
-				"--password=" . $options["prestashop_account_password"],
-				"--email=" . $options["prestashop_account_email"],
-				"--domain=" . $this->domain,
-				"--ssl=" . $ssl_enabled,
+				quoteshellarg($this->getDocRoot("/install/index_cli.php")),
+				"--db_server=" . quoteshellarg($options["database_host"]),
+				"--db_user=" .
+				quoteshellarg($this->appcontext->user() . "_" . $options["database_user"]),
+				"--db_password=" . quoteshellarg($options["database_password"]),
+				"--db_name=" .
+				quoteshellarg($this->appcontext->user() . "_" . $options["database_name"]),
+				"--firstname=" . quoteshellarg($options["prestashop_account_first_name"]),
+				"--lastname=" . quoteshellarg($options["prestashop_account_last_name"]),
+				"--password=" . quoteshellarg($options["prestashop_account_password"]),
+				"--email=" . quoteshellarg($options["prestashop_account_email"]),
+				"--domain=" . quoteshellarg($this->domain),
+				"--ssl=" . (int) $ssl_enabled,
 			],
 			$status,
 		);