πŸ”ž ADULT: Changeset/ - High Quality

Changeset 56425


Ignore:
Timestamp:
08/22/2023 12:45:12 PM (2 years ago)
Author:
audrasjb
Message:

General: 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.

Props frankit, azaozz.
Reviewed by audrasjb.
Merges [56417] to the 6.3 branch.
Fixes #59145.

Location:
branches/6.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.3

  • branches/6.3/src/wp-admin/includes/update-core.php

    r56366 r56425 Β 
    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.