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

WordPress Trac noreply at wordpress.org
Wed May 3 15:44:56 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 SergeyBiryukov):

 In [changeset:"55710" 55710]:
 {{{
 #!CommitTicketReference repository="" revision="55710"
 General: Restore `strpos()` check in `wp-admin/load-styles.php`.

 This resolves a fatal error on PHP < 8.0, as `wp-includes/compat.php` is
 not loaded in this file, so `str_starts_with()` may not be available.

 Follow-up to [55703].

 Props dd32, flixos90, DigTek.
 Fixes #58244. See #58012.
 }}}

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


More information about the wp-trac mailing list