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:
parent
e8acde751f
commit
ddafed6f4d
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user