[wp-trac] [WordPress Trac] #58206: Replace usage of strpos with str_contains

WordPress Trac noreply at wordpress.org
Fri Jan 12 11:46:15 UTC 2024


#58206: Replace usage of strpos with str_contains
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.3
Component:  General                              |     Version:
 Severity:  blocker                              |  Resolution:  fixed
 Keywords:  good-first-bug 2nd-opinion add-to-   |     Focuses:  coding-
  field-guide has-patch                          |  standards
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:67 poena]:
 > Do I understand correctly that the polyfill is only added to WordPress
 5.9 and later?
 >
 > The use of str_contains() in Twenty Twenty causes fatal errors because
 the theme supports WordPress version 4.7 and PHP 5.2.4.

 Good catch, thanks! Yes, the polyfill is only available in WordPress 5.9
 or later. Created a follow-up ticket: #60241.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58206#comment:68>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list