Changeset 25801
- Timestamp:
- 10/15/2013 11:02:28 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r25787 r25801 1252 1252 $wp_dir = trailingslashit($wp_filesystem->abspath()); 1253 1253 1254 // Pre-cache the checksums for the versions we care about1255 get_core_checksums( array( $wp_version, $current->version ) );1256 1257 1254 $partial = true; 1258 1255 if ( $parsed_args['do_rollback'] ) … … 1385 1382 1386 1383 function check_files() { 1387 global $wp_version ;1388 1389 $checksums = get_core_checksums( $wp_version );1390 1391 if ( empty( $checksums[ $wp_version ] ) || ! is_array( $checksums[ $wp_version ]) )1384 global $wp_version, $wp_local_package; 1385 1386 $checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' ); 1387 1388 if ( ! is_array( $checksums ) ) 1392 1389 return false; 1393 1390 1394 foreach ( $checksums [ $wp_version ]as $file => $checksum ) {1391 foreach ( $checksums as $file => $checksum ) { 1395 1392 // Skip files which get updated 1396 1393 if ( 'wp-content' == substr( $file, 0, 10 ) ) -
trunk/src/wp-admin/includes/update-core.php
r25800 r25801 697 697 // Check to see which files don't really need updating - only available for 3.7 and higher 698 698 if ( function_exists( 'get_core_checksums' ) ) { 699 $checksums = get_core_checksums( $wp_version ); 700 if ( ! empty( $checksums[ $wp_version ] ) && is_array( $checksums[ $wp_version ] ) ) { 701 foreach( $checksums[ $wp_version ] as $file => $checksum ) { 699 $checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' ); 700 if ( is_array( current( $checksums ) ) ) // Compat code for 3.7-beta2 701 $checksums = current( $checksums ); 702 if ( is_array( $checksums ) ) { 703 foreach( $checksums as $file => $checksum ) { 702 704 if ( 'wp-content' == substr( $file, 0, 10 ) ) 703 705 continue; 704 if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) === $checksum ) 706 if ( ! file_exists( ABSPATH . $file ) ) 707 continue; 708 if ( md5_file( ABSPATH . $file ) === $checksum ) 705 709 $skip[] = $file; 706 710 else … … 746 750 $skip = array( 'wp-content' ); 747 751 $failed = array(); 748 if ( ! empty( $checksums[ $wp_version ] ) && is_array( $checksums[ $wp_version ]) ) {749 foreach ( $checksums [ $wp_version ]as $file => $checksum ) {752 if ( is_array( $checksums ) ) { 753 foreach ( $checksums as $file => $checksum ) { 750 754 if ( 0 === strpos( $file, 'wp-content' ) ) 751 755 continue; -
trunk/src/wp-admin/includes/update.php
r25783 r25801 92 92 93 93 /** 94 * Gets and caches the checksums for the given version s of WordPress94 * Gets and caches the checksums for the given version of WordPress. 95 95 * 96 96 * @since 3.7.0 97 97 * 98 * @param $version string|array A single version, or an array of versions to fetch 99 * 100 * @return bool|array False on failure, otherwise the array of checksums, keyed by version 101 */ 102 function get_core_checksums( $version ) { 103 if ( ! is_array( $version ) ) 104 $version = array( $version ); 105 98 * @param string $version Version string to query. 99 * @param string $locale Locale to query. 100 * @return bool|array False on failure. An array of checksums on success. 101 */ 102 function get_core_checksums( $version, $locale ) { 106 103 $return = array(); 107 104 108 // Check to see if we have cached copies available, if we do, no need to request them 109 foreach ( $version as $i => $v ) { 110 if ( $checksums = get_site_transient( "core_checksums_$v" ) ) { 111 unset( $version[ $i ] ); 112 $return[ $v ] = $checksums; 113 } 114 } 115 116 // We had cached copies for all of the versions! 117 if ( empty( $version ) ) 118 return $return; 119 120 $url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( array( 'version' => $version ), null, '&' ); 105 $url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' ); 121 106 122 107 if ( wp_http_supports( array( 'ssl' ) ) ) … … 138 123 return false; 139 124 140 // Cache the checksums for later 141 foreach ( $version as $v ) { 142 if ( ! isset( $body['checksums'][ $v ] ) ) 143 $body['checksums'][ $v ] = false; 144 set_site_transient( "core_checksums_$v", $body['checksums'][ $v ], HOUR_IN_SECONDS ); 145 $return[ $v ] = $body['checksums'][ $v ]; 146 } 147 148 // If the API didn't return anything for a version, explicitly set it's return value to false 149 foreach ( $return as $v => $r ) { 150 if ( empty( $r ) ) 151 $return[ $v ] = false; 152 } 153 154 return $return; 125 return $body['checksums']; 155 126 } 156 127 -
trunk/src/wp-includes/version.php
r25800 r25801 5 5 * @global string $wp_version 6 6 */ 7 $wp_version = '3.7-beta2-2580 0-src';7 $wp_version = '3.7-beta2-25801-src'; 8 8 9 9 /**
Note: See TracChangeset
for help on using the changeset viewer.