Changeset 25540 for trunk/src/wp-admin/includes/class-wp-upgrader.php
- Timestamp:
- 09/21/2013 06:48:20 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r25496 r25540 1112 1112 $wp_dir = trailingslashit($wp_filesystem->abspath()); 1113 1113 1114 // Pre-cache the checksums for the versions we care about 1115 get_core_checksums( array( $wp_version, $current->version ) ); 1116 1117 $no_partial = false; 1118 if ( ! $this->check_files() ) 1119 $no_partial = true; 1120 1114 1121 // If partial update is returned from the API, use that, unless we're doing a reinstall. 1115 1122 // If we cross the new_bundled version number, then use the new_bundled zip. 1116 1123 // Don't though if the constant is set to skip bundled items. 1117 1124 // If the API returns a no_content zip, go with it. Finally, default to the full zip. 1118 if ( $current->packages->partial && 'reinstall' != $current->response && $wp_version == $current->partial_version )1125 if ( $current->packages->partial && 'reinstall' != $current->response && $wp_version == $current->partial_version && ! $no_partial ) 1119 1126 $to_download = 'partial'; 1120 1127 elseif ( $current->packages->new_bundled && version_compare( $wp_version, $current->new_bundled, '<' ) … … 1206 1213 } 1207 1214 1215 function check_files() { 1216 global $wp_version; 1217 1218 $checksums = get_core_checksums( $wp_version ); 1219 1220 if ( empty( $checksums[ $wp_version ] ) || ! is_array( $checksums[ $wp_version ] ) ) 1221 return false; 1222 1223 foreach ( $checksums[ $wp_version ] as $file => $checksum ) { 1224 if ( md5_file( ABSPATH . $file ) !== $checksum ) 1225 return false; 1226 } 1227 1228 return true; 1229 } 1208 1230 } 1209 1231
Note: See TracChangeset
for help on using the changeset viewer.