MD5 file verification: Prevent md5_file() warnings when files don't exist, additionally, don't verify wp-content files as they can be updated separately, as well as WP_CONTENT_DIR being set elsewhere. See #22704 See #18201

git-svn-id: https://develop.svn.wordpress.org/trunk@25648 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2013-09-29 23:07:59 +00:00
parent fefaa807e9
commit f1928e42bf
2 changed files with 7 additions and 2 deletions

View File

@ -1357,7 +1357,10 @@ class Core_Upgrader extends WP_Upgrader {
return false; return false;
foreach ( $checksums[ $wp_version ] as $file => $checksum ) { foreach ( $checksums[ $wp_version ] as $file => $checksum ) {
if ( md5_file( ABSPATH . $file ) !== $checksum ) // Skip files which get updated
if ( 'wp-content' == substr( $file, 0, 10 ) )
continue;
if ( ! file_exists( ABSPATH . $file ) || md5_file( ABSPATH . $file ) !== $checksum )
return false; return false;
} }

View File

@ -698,7 +698,9 @@ function update_core($from, $to) {
$checksums = get_core_checksums( $wp_version ); $checksums = get_core_checksums( $wp_version );
if ( ! empty( $checksums[ $wp_version ] ) && is_array( $checksums[ $wp_version ] ) ) { if ( ! empty( $checksums[ $wp_version ] ) && is_array( $checksums[ $wp_version ] ) ) {
foreach( $checksums[ $wp_version ] as $file => $checksum ) { foreach( $checksums[ $wp_version ] as $file => $checksum ) {
if ( md5_file( ABSPATH . $file ) === $checksum ) if ( 'wp-content' == substr( $file, 0, 10 ) )
continue;
if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) === $checksum )
$skip[] = $file; $skip[] = $file;
} }
} }