whitespace fix in __parseParams()

pull/343/merge
Christian Boltz 5 years ago
parent 4e9e3db75d
commit 9833a8f289
No known key found for this signature in database
GPG Key ID: C6A682EA63C82F1C

@ -323,22 +323,20 @@ class PostfixAdmin {
private function __parseParams($params) { private function __parseParams($params) {
$count = count($params); $count = count($params);
for ($i = 0; $i < $count; $i++) { for ($i = 0; $i < $count; $i++) {
# if (isset($params[$i])) { if ($params[$i] != '' && $params[$i]{0} === '-' && $params[$i] != '-1') {
if ($params[$i] != '' && $params[$i]{0} === '-' && $params[$i] != '-1') { $key = substr($params[$i], 1);
$key = substr($params[$i], 1); if (isset($params[$i+1])) {
if (isset($params[$i+1])) { # TODO: ideally we should know if a parameter can / must have a value instead of whitelisting known valid values starting with '-' (probably only bool doesn't need a value)
# TODO: ideally we should know if a parameter can / must have a value instead of whitelisting known valid values starting with '-' (probably only bool doesn't need a value) if ($params[$i+1]{0} === '-' && $params[$i+1] != '-1') {
if ($params[$i+1]{0} === '-' && $params[$i+1] != '-1') { $this->params[$key] = true;
$this->params[$key] = true; } else {
} else { $this->params[$key] = $params[$i+1];
$this->params[$key] = $params[$i+1]; $i++;
$i++;
}
} }
} else {
$this->args[] = $params[$i];
} }
# } } else {
$this->args[] = $params[$i];
}
} }
} }

Loading…
Cancel
Save