Make WordPress Core

Changeset 56417


Ignore:
Timestamp:
08/18/2023 11:23:33 PM (3 years ago)
Author:
azaozz
Message:

Revert the last use of str_starts_with() in update-core.php.

Fixes updating WordPress from 5.7 and earlier versions. When doing the update this file runs first in the old version where the polifills may not be available.

Porps: frankit.
Fixes: #59145.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/update-core.php

    r56365 r56417  
    14321432                        $lang_dir = WP_CONTENT_DIR . '/languages';
    14331433                }
    1434 
     1434                /*
     1435                 * Note: str_starts_with() is not used here, as this file is included
     1436                 * when updating from older WordPress versions, in which case
     1437                 * the polyfills from wp-includes/compat.php may not be available.
     1438                 */
    14351439                // Check if the language directory exists first.
    1436                 if ( ! @is_dir( $lang_dir ) && str_starts_with( $lang_dir, ABSPATH ) ) {
     1440                if ( ! @is_dir( $lang_dir ) && 0 === strpos( $lang_dir, ABSPATH ) ) {
    14371441                        // If it's within the ABSPATH we can handle it here, otherwise they're out of luck.
    14381442                        $wp_filesystem->mkdir( $to . str_replace( ABSPATH, '', $lang_dir ), FS_CHMOD_DIR );
Note: See TracChangeset for help on using the changeset viewer.