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

WordPress Trac noreply at wordpress.org
Tue Jun 27 17:34:15 UTC 2023


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

Comment (by SergeyBiryukov):

 Replying to [comment:44 westonruter]:
 > When running the wordpress-develop core development site in 7.4 I found
 a fatal error due to the changes here, specifically r56031. I get:
 >
 > {{{
 > Fatal error:  Uncaught Error: Call to undefined function str_ends_with()
 in /var/www/src/wp-includes/load.php:76
 > Stack trace:
 > #0 /var/www/src/index.php(27): wp_fix_server_vars()
 > #1 {main}
 >   thrown in /var/www/src/wp-includes/load.php on line 76
 > }}}

 Thanks! It looks like the changes to `wp-includes/load.php` from
 [55990,56014,56031,56032] were reverted in [56065], so this should not be
 a blocker for Beta 1.

 Unless I'm missing something, [attachment:"58206.diff"] might not resolve
 this particular issue. When `wp_fix_server_vars()` runs in `wp-
 settings.php`, `compat.php` is already loaded, even without the patch.
 However, it is not loaded in `src/index.php`, which is the entry point
 here.

 I would like to take a closer look at reintroducing these changes after
 making sure the polyfills are available for use in all of the known entry
 points, as suggested in comment:33, except maybe for `wp-
 admin/load-(scripts|styles).php` and `script-loader.php`, as per
 comment:37:ticket:58012.

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


More information about the wp-trac mailing list