0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

fix php8 moaning about { } on strings

This commit is contained in:
David Goodwin 2021-01-18 20:46:25 +00:00
parent e8acde751f
commit ddafed6f4d

View File

@ -319,11 +319,11 @@ class PostfixAdmin {
public function parseParams($params) {
$count = count($params);
for ($i = 0; $i < $count; $i++) {
if ($params[$i] != '' && $params[$i]{0} === '-' && $params[$i] != '-1') {
if ($params[$i] != '' && $params[$i][0] === '-' && $params[$i] != '-1') {
$key = substr($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)
if ($params[$i+1]{0} === '-' && $params[$i+1] != '-1') {
if ($params[$i+1][0] === '-' && $params[$i+1] != '-1') {
$this->params[$key] = true;
} else {
$this->params[$key] = $params[$i+1];