Skip to content

Commit 21269bf

Browse files
authored
Remove deprecated curly braces (#28)
1 parent 1b17c5e commit 21269bf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/phputf8/utils/bad.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ function utf8_bad_replace($str, $replace = '?') {
226226
/**
227227
* Reports on the type of bad byte found in a UTF-8 string. Returns a
228228
* status code on the first bad byte found
229+
*
230+
* Joomla modification - As of PHP 7.4, curly brace access has been deprecated. As a result this function has been
231+
* modified to use square brace syntax
232+
* See https://github.com/php/php-src/commit/d574df63dc375f5fc9202ce5afde23f866b6450a
233+
* for additional references
234+
*
229235
* @author <hsivonen@iki.fi>
230236
* @param string UTF-8 encoded string
231237
* @return mixed integer constant describing problem or FALSE if valid UTF-8
@@ -244,7 +250,7 @@ function utf8_bad_identify($str, &$i) {
244250

245251
for($i = 0; $i < $len; $i++) {
246252

247-
$in = ord($str{$i});
253+
$in = ord($str[$i]);
248254

249255
if ( $mState == 0) {
250256

0 commit comments

Comments
 (0)