diff --git a/PHP/api_classes/idna_convert.php b/PHP/api_classes/idna_convert.php index a07689c..4444f7a 100644 --- a/PHP/api_classes/idna_convert.php +++ b/PHP/api_classes/idna_convert.php @@ -76,6 +76,7 @@ class idna_convert protected $_tcount = 28; protected $_ncount = 588; // _vcount * _tcount protected $_scount = 11172; // _lcount * _tcount * _vcount + protected $slast; protected $_error = false; protected static $_mb_string_overload = null; @@ -420,7 +421,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); @@ -434,7 +435,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)); @@ -828,7 +829,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; @@ -957,7 +958,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; }