From: Alexander Ebert Date: Mon, 27 Jan 2020 15:32:16 +0000 (+0100) Subject: Deprecated string offset in Net_IDNA2 (PHP 7.4) X-Git-Tag: 5.4.0_Alpha_1~740^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3f01c0baf02f2ec42771fea0f26abb9480c2ee87;p=GitHub%2FWoltLab%2FWCF.git Deprecated string offset in Net_IDNA2 (PHP 7.4) (cherry picked from commit f1d17510cf7d5aa224ad10936ba4529990de127e) --- 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; }