[wp-trac] [WordPress Trac] #50197: PHP 7.4 Compatibility with WP 5.4.1 – problem with seems_utf8()

WordPress Trac noreply at wordpress.org
Sun May 17 18:42:09 UTC 2020


#50197: PHP 7.4 Compatibility with WP 5.4.1 – problem with seems_utf8()
--------------------------+-----------------------------
 Reporter:  fohly         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.4.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50197>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list