Skip to content

Commit

Permalink
Remove deprecated curly braces (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkyKZ authored Oct 7, 2020
1 parent 1b17c5e commit 21269bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/phputf8/utils/bad.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* @param string UTF-8 encoded string
* @return mixed integer constant describing problem or FALSE if valid UTF-8
Expand All @@ -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) {

Expand Down

0 comments on commit 21269bf

Please sign in to comment.