diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 8d672199ee..6085b02c8f 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -1431,9 +1431,13 @@ function update_core( $from, $to ) { } else { $lang_dir = WP_CONTENT_DIR . '/languages'; } - + /* + * Note: str_starts_with() is not used here, as this file is included + * when updating from older WordPress versions, in which case + * the polyfills from wp-includes/compat.php may not be available. + */ // Check if the language directory exists first. - if ( ! @is_dir( $lang_dir ) && str_starts_with( $lang_dir, ABSPATH ) ) { + if ( ! @is_dir( $lang_dir ) && 0 === strpos( $lang_dir, ABSPATH ) ) { // If it's within the ABSPATH we can handle it here, otherwise they're out of luck. $wp_filesystem->mkdir( $to . str_replace( ABSPATH, '', $lang_dir ), FS_CHMOD_DIR ); clearstatcache(); // For FTP, need to clear the stat cache. diff --git a/wp-includes/version.php b/wp-includes/version.php index 5b098339a2..14a9861cd6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-alpha-56416'; +$wp_version = '6.4-alpha-56417'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.