Make WordPress Core

Changeset 55710


Ignore:
Timestamp:
05/03/2023 03:44:39 PM (11 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/load-styles.php

    r55703 r55710  
    7474    $content = get_file( $path ) . "\n";
    7575
    76     if ( str_starts_with( $style->src, '/' . WPINC . '/css/' ) ) {
     76    // str_starts_with() is not used here, as wp-includes/compat.php is not loaded in this file.
     77    if ( 0 === strpos( $style->src, '/' . WPINC . '/css/' ) ) {
    7778        $content = str_replace( '../images/', '../' . WPINC . '/images/', $content );
    7879        $content = str_replace( '../js/tinymce/', '../' . WPINC . '/js/tinymce/', $content );
Note: See TracChangeset for help on using the changeset viewer.