Make WordPress Core


Ignore:
Timestamp:
10/14/2013 10:24:28 PM (13 years ago)
Author:
nacin
Message:

Parse absolute paths out of error data. see #22704.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/update-core.php

    r25778 r25780  
    717717        // Copy new versions of WP files into place.
    718718        $result = _copy_dir( $from . $distro, $to, $skip );
     719        if ( is_wp_error( $result ) )
     720                $result = new WP_Error( $result->get_error_code(), $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) );
    719721
    720722        // Check to make sure everything copied correctly, ignoring the contents of wp-content
    … …  
    745747                $available_space = disk_free_space( ABSPATH );
    746748                if ( $available_space && $total_size >= $available_space ) {
    747                         $result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ), $to );
     749                        $result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ) );
    748750                } else {
    749751                        $result = _copy_dir( $from . $distro, $to, $skip );
    750752                        if ( is_wp_error( $result ) )
    751                                 $result = new WP_Error( $result->get_error_code() . '_retry', $result->get_error_message(), $result->get_error_data() );
     753                                $result = new WP_Error( $result->get_error_code() . '_retry', $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) );
    752754                }
    753755        }
    … …  
    771773                                $result = copy_dir($from . $distro . 'wp-content/languages/', $wp_lang_dir);
    772774                                if ( is_wp_error( $result ) )
    773                                         $result = new WP_Error( $result->get_error_code() . '_languages', $result->get_error_message(), $result->get_error_data() );
     775                                        $result = new WP_Error( $result->get_error_code() . '_languages', $result->get_error_message(), substr( $result->get_error_data(), strlen( $wp_lang_dir ) ) );
    774776                        }
    775777                }
    … …  
    821823                                                if ( ! is_wp_error( $result ) )
    822824                                                        $result = new WP_Error;
    823                                                 $result->add( $_result->get_error_code() . "_$type", $_result->get_error_message(), $_result->get_error_data() );
     825                                                $result->add( $_result->get_error_code() . "_$type", $_result->get_error_message(), substr( $_result->get_error_data(), strlen( $dest ) ) );
    824826                                        }
    825827                                }
Note: See TracChangeset for help on using the changeset viewer.