Skip to content

Commit 5a3a886

Browse files
fortify NextcloudSetup (hestiacp#4566)
* fortify NextcloudSetup * Run NPM format --------- Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent e36b725 commit 5a3a886

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

web/src/app/WebApp/Installers/Nextcloud/NextcloudSetup.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Hestia\WebApp\Installers\Nextcloud;
44

55
use Hestia\WebApp\Installers\BaseSetup as BaseSetup;
6+
use function Hestiacp\quoteshellarg\quoteshellarg;
67

78
class NextcloudSetup extends BaseSetup {
89
protected $appInfo = [
@@ -47,15 +48,17 @@ public function install(array $options = null): bool {
4748
"v-run-cli-cmd",
4849
[
4950
"/usr/bin/php" . $options["php_version"],
50-
$this->getDocRoot("occ"),
51+
quoteshellarg($this->getDocRoot("occ")),
5152
"maintenance:install",
5253
"--database mysql",
53-
"--database-name " . $this->appcontext->user() . "_" . $options["database_name"],
54-
"--database-host " . $options["database_host"],
55-
"--database-user " . $this->appcontext->user() . "_" . $options["database_user"],
56-
"--database-pass " . $options["database_password"],
57-
"--admin-user " . $options["username"],
58-
"--admin-pass " . $options["password"],
54+
"--database-name " .
55+
quoteshellarg($this->appcontext->user() . "_" . $options["database_name"]),
56+
"--database-host " . quoteshellarg($options["database_host"]),
57+
"--database-user " .
58+
quoteshellarg($this->appcontext->user() . "_" . $options["database_user"]),
59+
"--database-pass " . quoteshellarg($options["database_password"]),
60+
"--admin-user " . quoteshellarg($options["username"]),
61+
"--admin-pass " . quoteshellarg($options["password"]),
5962
],
6063
$status,
6164
);
@@ -64,9 +67,9 @@ public function install(array $options = null): bool {
6467
"v-run-cli-cmd",
6568
[
6669
"/usr/bin/php" . $options["php_version"],
67-
$this->getDocRoot("occ"),
70+
quoteshellarg($this->getDocRoot("occ")),
6871
"config:system:set",
69-
"trusted_domains 2 --value=" . $this->domain,
72+
"trusted_domains 2 --value=" . quoteshellarg($this->domain),
7073
],
7174
$status,
7275
);

0 commit comments

Comments
 (0)