33namespace Hestia \WebApp \Installers \Nextcloud ;
44
55use Hestia \WebApp \Installers \BaseSetup as BaseSetup ;
6+ use function Hestiacp \quoteshellarg \quoteshellarg ;
67
78class 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