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

WordPress Trac noreply at wordpress.org
Mon Aug 14 16:39:46 UTC 2023


#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                                    |  standards
-------------------------------------------------+-------------------------

Comment (by frankit):

 Replying to [comment:55 azaozz]:
 > In [changeset:"56088" 56088]:
 > {{{
 > #!CommitTicketReference repository="" revision="56088"
 > Revert use of `str_starts_with()` and `str_contains()` in `update-
 core.php`.
 >
 > Fixes updating WordPress from 5.7 and earlier versions. When updating
 this file runs first in the old version where the polifills may not be
 available.
 >
 > Props: ironprogrammer, SergeyBiryukov, dd32, azaozz.
 > See: #58206.
 > }}}

 I might be wrong but I just commented on the
 [https://github.com/WordPress/WordPress/commit/0a265883b9debbe3e58dd6402020a884f036e234
 #diff-
 45f5a3ce81132466923ad5e000bf32bcf007f83c0eee15dfed81aac6b51ea6f9R1429
 github commit] that it looks to me that `str_starts_with()` on
 [https://github.com/WordPress/WordPress/commit/0a265883b9debbe3e58dd6402020a884f036e234
 #diff-
 45f5a3ce81132466923ad5e000bf32bcf007f83c0eee15dfed81aac6b51ea6f9R1429 line
 1429] has been left over.
 I'm getting `Fatal error: Uncaught Error: Call to undefined function
 str_starts_with() [...]` from that line while trying to update from a wp <
 5.7 to latest 6.3

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


More information about the wp-trac mailing list