PHP 7.4 Compatibility with WP 5.4.1 – problem with seems_utf8()
-
Since I updated to PHP 7.4 I with the newest WordPress version 5.4.1 I am getting error notices when seems_utf8() from formatting.php is called with an integer as parameter. (This seems to happen when something around Buddypress (v 5.2) leads to calling this function and passes some integer id. I have not found the origin of this yet).
PHP 7.3 still seems to accept that and will still interpret $str[ $i ] in line 904.
From 7.4 this will lead to an error notice “Trying to access array offset on value of type int …”. In addition, after the error notice all special characters on the page rendered are not displayed correctly anymore.
Can you please prevent this from happening? A line in the beginning of the function like
$str = (string) $str;
can fix this error notice.
Maybe there is a more elegant way to prevent this, but I right now I don’t find it …Best regards
Florian
- The topic ‘PHP 7.4 Compatibility with WP 5.4.1 – problem with seems_utf8()’ is closed to new replies.