mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-14 22:56:19 +01:00
When checking filesystem permissions for core updates, only check the permissions of the files which we need to alter.
Merges [26014] from 3.8 to the 3.7 branch. fixes #25771. Built from https://develop.svn.wordpress.org/branches/3.7@27882 git-svn-id: http://core.svn.wordpress.org/branches/3.7@27713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fe261114bd
commit
8930937bf0
@ -697,6 +697,9 @@ function update_core($from, $to) {
|
|||||||
|
|
||||||
// Check to see which files don't really need updating - only available for 3.7 and higher
|
// Check to see which files don't really need updating - only available for 3.7 and higher
|
||||||
if ( function_exists( 'get_core_checksums' ) ) {
|
if ( function_exists( 'get_core_checksums' ) ) {
|
||||||
|
// Find the local version of the working directory
|
||||||
|
$working_dir_local = WP_CONTENT_DIR . '/upgrade/' . basename( $from ) . $distro;
|
||||||
|
|
||||||
$checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );
|
$checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );
|
||||||
if ( is_array( $checksums ) && isset( $checksums[ $wp_version ] ) )
|
if ( is_array( $checksums ) && isset( $checksums[ $wp_version ] ) )
|
||||||
$checksums = $checksums[ $wp_version ]; // Compat code for 3.7-beta2
|
$checksums = $checksums[ $wp_version ]; // Compat code for 3.7-beta2
|
||||||
@ -706,6 +709,8 @@ function update_core($from, $to) {
|
|||||||
continue;
|
continue;
|
||||||
if ( ! file_exists( ABSPATH . $file ) )
|
if ( ! file_exists( ABSPATH . $file ) )
|
||||||
continue;
|
continue;
|
||||||
|
if ( ! file_exists( $working_dir_local . $file ) )
|
||||||
|
continue;
|
||||||
if ( md5_file( ABSPATH . $file ) === $checksum )
|
if ( md5_file( ABSPATH . $file ) === $checksum )
|
||||||
$skip[] = $file;
|
$skip[] = $file;
|
||||||
else
|
else
|
||||||
@ -752,9 +757,10 @@ function update_core($from, $to) {
|
|||||||
$failed = array();
|
$failed = array();
|
||||||
if ( isset( $checksums ) && is_array( $checksums ) ) {
|
if ( isset( $checksums ) && is_array( $checksums ) ) {
|
||||||
foreach ( $checksums as $file => $checksum ) {
|
foreach ( $checksums as $file => $checksum ) {
|
||||||
if ( 0 === strpos( $file, 'wp-content' ) )
|
if ( 'wp-content' == substr( $file, 0, 10 ) )
|
||||||
|
continue;
|
||||||
|
if ( ! file_exists( $working_dir_local . $file ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) == $checksum )
|
if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) == $checksum )
|
||||||
$skip[] = $file;
|
$skip[] = $file;
|
||||||
else
|
else
|
||||||
@ -765,8 +771,6 @@ function update_core($from, $to) {
|
|||||||
// Some files didn't copy properly
|
// Some files didn't copy properly
|
||||||
if ( ! empty( $failed ) ) {
|
if ( ! empty( $failed ) ) {
|
||||||
$total_size = 0;
|
$total_size = 0;
|
||||||
// Find the local version of the working directory
|
|
||||||
$working_dir_local = WP_CONTENT_DIR . '/upgrade/' . basename( $from ) . $distro;
|
|
||||||
foreach ( $failed as $file ) {
|
foreach ( $failed as $file ) {
|
||||||
if ( file_exists( $working_dir_local . $file ) )
|
if ( file_exists( $working_dir_local . $file ) )
|
||||||
$total_size += filesize( $working_dir_local . $file );
|
$total_size += filesize( $working_dir_local . $file );
|
||||||
|
Loading…
Reference in New Issue
Block a user