From 21269bfcddef4e676c6a1a49b7d959f896522a96 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Wed, 7 Oct 2020 11:01:44 +0300 Subject: [PATCH] Remove deprecated curly braces (#28) --- src/phputf8/utils/bad.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/phputf8/utils/bad.php b/src/phputf8/utils/bad.php index e8b8f117..3e54fc22 100644 --- a/src/phputf8/utils/bad.php +++ b/src/phputf8/utils/bad.php @@ -226,6 +226,12 @@ function utf8_bad_replace($str, $replace = '?') { /** * Reports on the type of bad byte found in a UTF-8 string. Returns a * status code on the first bad byte found +* +* Joomla modification - As of PHP 7.4, curly brace access has been deprecated. As a result this function has been +* modified to use square brace syntax +* See https://github.com/php/php-src/commit/d574df63dc375f5fc9202ce5afde23f866b6450a +* for additional references +* * @author * @param string UTF-8 encoded string * @return mixed integer constant describing problem or FALSE if valid UTF-8 @@ -244,7 +250,7 @@ function utf8_bad_identify($str, &$i) { for($i = 0; $i < $len; $i++) { - $in = ord($str{$i}); + $in = ord($str[$i]); if ( $mState == 0) {