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.


git-svn-id: https://develop.svn.wordpress.org/trunk@25805 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-10-16 04:01:12 +00:00
parent b89ea9ea66
commit 4f7112000f
1 changed files with 2 additions and 2 deletions

View File

@ -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 ) )