|
4 | 4 |
|
5 | 5 | use Hestia\System\Util; |
6 | 6 | use Hestia\WebApp\Installers\BaseSetup as BaseSetup; |
| 7 | +use function Hestiacp\quoteshellarg\quoteshellarg; |
7 | 8 |
|
8 | 9 | class MediaWikiSetup extends BaseSetup { |
9 | 10 | protected $appInfo = [ |
@@ -68,19 +69,22 @@ public function install(array $options = null) { |
68 | 69 | "v-run-cli-cmd", |
69 | 70 | [ |
70 | 71 | "/usr/bin/php" . $options["php_version"], |
71 | | - $this->getDocRoot("maintenance/install.php"), |
72 | | - "--dbserver=" . $options["database_host"], |
73 | | - "--dbname=" . $this->appcontext->user() . "_" . $options["database_name"], |
74 | | - "--installdbuser=" . $this->appcontext->user() . "_" . $options["database_user"], |
75 | | - "--installdbpass=" . $options["database_password"], |
76 | | - "--dbuser=" . $this->appcontext->user() . "_" . $options["database_user"], |
77 | | - "--dbpass=" . $options["database_password"], |
78 | | - "--server=" . $webDomain, |
| 72 | + quoteshellarg($this->getDocRoot("maintenance/install.php")), |
| 73 | + "--dbserver=" . quoteshellarg($options["database_host"]), |
| 74 | + "--dbname=" . |
| 75 | + quoteshellarg($this->appcontext->user() . "_" . $options["database_name"]), |
| 76 | + "--installdbuser=" . |
| 77 | + quoteshellarg($this->appcontext->user() . "_" . $options["database_user"]), |
| 78 | + "--installdbpass=" . quoteshellarg($options["database_password"]), |
| 79 | + "--dbuser=" . |
| 80 | + quoteshellarg($this->appcontext->user() . "_" . $options["database_user"]), |
| 81 | + "--dbpass=" . quoteshellarg($options["database_password"]), |
| 82 | + "--server=" . quoteshellarg($webDomain), |
79 | 83 | "--scriptpath=", // must NOT be / |
80 | | - "--lang=" . $options["language"], |
81 | | - "--pass=" . $options["admin_password"], |
| 84 | + "--lang=" . quoteshellarg($options["language"]), |
| 85 | + "--pass=" . quoteshellarg($options["admin_password"]), |
82 | 86 | "MediaWiki", // A Space here would trigger the next argument and preemptively set the admin username |
83 | | - $options["admin_username"], |
| 87 | + quoteshellarg($options["admin_username"]), |
84 | 88 | ], |
85 | 89 | $status, |
86 | 90 | ); |
|
0 commit comments