Make WordPress Core

Changeset 24313


Ignore:
Timestamp:
05/22/2013 04:57:20 PM (12 years ago)
Author:
azaozz
Message:

Add more specific error messages when upgrading themes and plugins and the package cannot be extracted (no files), props SergeyBiryukov, fixes #24223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r24276 r24313  
    5151        $this->strings['download_failed'] = __('Download failed.');
    5252        $this->strings['installing_package'] = __('Installing the latest version…');
     53        $this->strings['no_files'] = __('The package contains no files.');
    5354        $this->strings['folder_exists'] = __('Destination folder already exists.');
    5455        $this->strings['mkdir_failed'] = __('Could not create directory.');
     
    195196            $source = trailingslashit($source) . trailingslashit($source_files[0]);
    196197        elseif ( count($source_files) == 0 )
    197             return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __( 'The plugin contains no files.' ) ); //There are no files?
     198            return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $this->strings['no_files'] ); //There are no files?
    198199        else //It's only a single file, the upgrader will use the foldername of this file as the destination folder. foldername is based on zip filename.
    199200            $source = trailingslashit($source);
     
    389390        $this->strings['unpack_package'] = __('Unpacking the package…');
    390391        $this->strings['installing_package'] = __('Installing the plugin…');
     392        $this->strings['no_files'] = __('The plugin contains no files.');
    391393        $this->strings['process_failed'] = __('Plugin install failed.');
    392394        $this->strings['process_success'] = __('Plugin installed successfully.');
     
    668670        $this->strings['unpack_package'] = __('Unpacking the package…');
    669671        $this->strings['installing_package'] = __('Installing the theme…');
     672        $this->strings['no_files'] = __('The theme contains no files.');
    670673        $this->strings['process_failed'] = __('Theme install failed.');
    671674        $this->strings['process_success'] = __('Theme installed successfully.');
     
    12401243    function add_strings() {
    12411244        $this->upgrader->strings['skin_upgrade_start'] = __('The update process is starting. This process may take a while on some hosts, so please be patient.');
    1242         $this->upgrader->strings['skin_update_failed_error'] = __('An error occurred while updating %1$s: <strong>%2$s</strong>.');
     1245        $this->upgrader->strings['skin_update_failed_error'] = __('An error occurred while updating %1$s: <strong>%2$s</strong>');
    12431246        $this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.');
    12441247        $this->upgrader->strings['skin_update_successful'] = __('%1$s updated successfully.').' <a onclick="%2$s" href="#" class="hide-if-no-js"><span>'.__('Show Details').'</span><span class="hidden">'.__('Hide Details').'</span>.</a>';
Note: See TracChangeset for help on using the changeset viewer.