mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
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
Built from https://develop.svn.wordpress.org/trunk@25648 git-svn-id: http://core.svn.wordpress.org/trunk@25565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6e9ba8be22
commit
7ed4059230
@ -1357,7 +1357,10 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
return false;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -698,7 +698,9 @@ function update_core($from, $to) {
|
||||
$checksums = get_core_checksums( $wp_version );
|
||||
if ( ! empty( $checksums[ $wp_version ] ) && is_array( $checksums[ $wp_version ] ) ) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user