From f1d17510cf7d5aa224ad10936ba4529990de127e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 27 Jan 2020 16:32:16 +0100 Subject: [PATCH] Deprecated string offset in Net_IDNA2 (PHP 7.4) --- .../files/lib/system/api/pear/net_idna2/Net/IDNA2.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/api/pear/net_idna2/Net/IDNA2.php b/wcfsetup/install/files/lib/system/api/pear/net_idna2/Net/IDNA2.php index c56791cb32..9640006f5c 100644 --- a/wcfsetup/install/files/lib/system/api/pear/net_idna2/Net/IDNA2.php +++ b/wcfsetup/install/files/lib/system/api/pear/net_idna2/Net/IDNA2.php @@ -2683,7 +2683,7 @@ class Net_IDNA2 if ($delim_pos > self::_byteLength($this->_punycode_prefix)) { for ($k = self::_byteLength($this->_punycode_prefix); $k < $delim_pos; ++$k) { - $decoded[] = ord($encoded{$k}); + $decoded[] = ord($encoded[$k]); } } else { $decoded = array(); @@ -2700,7 +2700,7 @@ class Net_IDNA2 for ($enco_idx = ($delim_pos)? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) { for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) { - $digit = $this->_decodeDigit($encoded{$enco_idx++}); + $digit = $this->_decodeDigit($encoded[$enco_idx++]); $idx += $digit * $w; $t = ($k <= $bias) ? @@ -3112,7 +3112,7 @@ class Net_IDNA2 $mode = 'next'; $test = 'none'; for ($k = 0; $k < $inp_len; ++$k) { - $v = ord($input{$k}); // Extract byte from input string + $v = ord($input[$k]); // Extract byte from input string if ($v < 128) { // We found an ASCII char - put into string as is $output[$out_len] = $v; @@ -3279,7 +3279,7 @@ class Net_IDNA2 $out_len++; $output[$out_len] = 0; } - $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); + $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) ); } return $output; } -- 2.20.1