From b11600fcaaa6200b1a57bc44c25749833208d6cb Mon Sep 17 00:00:00 2001 From: meow257 Date: Fri, 23 Dec 2022 15:00:41 +0400 Subject: [PATCH] Update idna_convert.class.php PHP 8. Curly braces is no longer supported. --- idna_convert.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/idna_convert.class.php b/idna_convert.class.php index ed32dc8..d63df01 100644 --- a/idna_convert.class.php +++ b/idna_convert.class.php @@ -423,7 +423,7 @@ protected function _decode($encoded) $delim_pos = strrpos($encoded, '-'); 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]); } } $deco_len = count($decoded); @@ -437,7 +437,7 @@ protected function _decode($encoded) 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->_decode_digit($encoded{$enco_idx++}); + $digit = $this->_decode_digit($encoded[$enco_idx++]); $idx += $digit * $w; $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); @@ -864,7 +864,7 @@ protected function _utf8_to_ucs4($input) $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 stirng as is $output[$out_len] = $v; ++$out_len; @@ -995,7 +995,7 @@ protected function _ucs4_string_to_ucs4($input) $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; } @@ -3458,4 +3458,4 @@ public function singleton($params = array()) 0x361 => 234, 0x345 => 240 ) ); -} \ No newline at end of file +}