From 9fe39c464a3ed4acbc93407d49dc5107e1f91db1 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 16 Oct 2013 04:02:09 +0000 Subject: [PATCH] Avoid numerous potential PHP warnings when dealing with the pre-r25801 get_core_checksums() return value. Warnings included current(), filestat(), and md5_file(). see #18201. see #22704. Built from https://develop.svn.wordpress.org/trunk@25805 git-svn-id: http://core.svn.wordpress.org/trunk@25717 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 5f3eaaf572..2ded5c6a94 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -697,8 +697,8 @@ function update_core($from, $to) { // Check to see which files don't really need updating - only available for 3.7 and higher if ( function_exists( 'get_core_checksums' ) ) { $checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' ); - if ( is_array( current( $checksums ) ) ) // Compat code for 3.7-beta2 - $checksums = current( $checksums ); + if ( is_array( $checksums ) && isset( $checksums[ $wp_version ] ) ) + $checksums = $checksums[ $wp_version ]; // Compat code for 3.7-beta2 if ( is_array( $checksums ) ) { foreach( $checksums as $file => $checksum ) { if ( 'wp-content' == substr( $file, 0, 10 ) )