From 5918ff8d0ddbaf5b7086bd051f2786ceb1ed6065 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 25 Mar 2021 14:33:38 +0100 Subject: Fix deprecated curly braces string indexing (PHP 7.4) --- modules-available/sysconfig/inc/ppd.inc.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'modules-available/sysconfig/inc') diff --git a/modules-available/sysconfig/inc/ppd.inc.php b/modules-available/sysconfig/inc/ppd.inc.php index 9bd5d171..e48f1652 100644 --- a/modules-available/sysconfig/inc/ppd.inc.php +++ b/modules-available/sysconfig/inc/ppd.inc.php @@ -320,7 +320,7 @@ class Ppd $no = 0; while ($lStart < $this->dataLen && $lEnd !== false) { unset($mainKeyword, $optionKeyword, $optionTranslation, $option, $value, $valueTranslation); - if ($no !== 0 && $this->data{$lEnd} === "\r" && $this->data{$lEnd + 1} === "\n") { + if ($no !== 0 && $this->data[$lEnd] === "\r" && $this->data[$lEnd + 1] === "\n") { $lEnd++; } if ($no === 1) { @@ -373,8 +373,8 @@ class Ppd } } // 3) Handle "key [option]: value" - if ($line{0} === '*') { - if ($line{1} === '%') { + if ($line[0] === '*') { + if ($line[1] === '%') { // Skip comment continue; } @@ -394,7 +394,7 @@ class Ppd $optionTranslation = isset($out[4]) ? $this->unhexTranslation($no, substr($out[4], 1)) : $optionKeyword; // If no translation given, fallback to option // 3b) Handle value $value = $parts[1]; - if ($value{0} === '"') { + if ($value[0] === '"') { // Start of InvocationValue or QuotedValue if (preg_match(',^"([^"]*)"(/.*)?$,', $value, $vMatch)) { // Single line @@ -459,7 +459,7 @@ class Ppd $this->error = 'Line ' . $no . ': ' . $mainKeyword . ' with no option keyword'; return; } - if ($optionKeyword{0} !== '*') { + if ($optionKeyword[0] !== '*') { $this->error = 'Line ' . $no . ': ' . $mainKeyword . " with option keyword that doesn't start with asterisk (*)."; return; } @@ -569,7 +569,7 @@ class Ppd $option = $this->getOption($optionKeyword, $currentBlock); $option->customParam = new PpdOption($lStart, $len, $value, $valueTranslation); } - } elseif ($mainKeyword{0} === '?') { + } elseif ($mainKeyword[0] === '?') { // Ignoring option query for now } elseif ($optionKeyword === false && !isset($this->KNOWN_KEYWORDS[$mainKeyword])) { // Must be a definition for an option @@ -674,7 +674,7 @@ class Ppd if ($start >= $this->dataLen) return false; while ($start < $this->dataLen) { - $char = $this->data{$start}; + $char = $this->data[$start]; if ($char === "\r" || $char === "\n") return $start; ++$start; @@ -853,10 +853,10 @@ class Ppd foreach ($ranges as $range) { $new .= substr($this->data, $last, $range[0] - $last); $last = $range[1]; - if ($this->data{$last} === "\r") { + if ($this->data[$last] === "\r") { $last++; } - if ($this->data{$last} === "\n") { + if ($this->data[$last] === "\n") { $last++; } } @@ -882,7 +882,7 @@ class Ppd $pos = $setting->default->lineOffset; } elseif ($setting->block !== false && $setting->block->isUi()) { $pos = $this->nextLineEnd($setting->block->start); - while ($pos !== false && $pos < $this->dataLen && ($this->data{$pos} === "\r" || $this->data{$pos} === "\n")) { + while ($pos !== false && $pos < $this->dataLen && ($this->data[$pos] === "\r" || $this->data[$pos] === "\n")) { $pos++; } } -- cgit v1.2.3-55-g7522