[wp-trac] [WordPress Trac] #58012: Replace usage of strpos with str_starts_with

WordPress Trac noreply at wordpress.org
Wed May 3 17:45:11 UTC 2023


#58012: Replace usage of strpos with str_starts_with
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.3
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch 2nd-        |     Focuses:
  opinion                                        |  performance
-------------------------------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:34 spacedmonkey]:
 > I have a fix on [https://github.com/WordPress/wordpress-
 develop/pull/4418 #4418].

 Sorry but that is the wrong way to do this. If you really cannot stand
 seeing the "legacy" way for testing whether a string starts with
 something, I'd suggest adding the polyfill to `wp-
 admin/includes/noop.php`. This is the proper place for it.

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


More information about the wp-trac mailing list