Make WordPress Core

Changeset 11080


Ignore:
Timestamp:
04/24/2009 04:53:35 PM (13 years ago)
Author:
ryan
Message:

Better error messages. Props DD32. see #7875

File:
1 edited

Legend:

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

    r11028 r11080  
    723723            $this->feedback($errors);
    724724        } elseif ( is_wp_error($errors) && $errors->get_error_code() ) {
    725             foreach ( $errors->get_error_messages() as $message )
    726                 $this->feedback($message);
     725            foreach ( $errors->get_error_messages() as $message ) {
     726                if ( $errors->get_error_data() )
     727                    $this->feedback($message . ' ' . $errors->get_error_data() );
     728                else
     729                    $this->feedback($message);
     730            }
    727731        }
    728732    }
     
    732736            $string = $this->upgrader->strings[$string];
    733737
    734         $args = func_get_args();
    735         $args = array_splice($args, 1);
    736         if ( !empty($args) )
    737             $string = vsprintf($string, $args);
     738        if ( strpos($string, '%') !== false ) {
     739            $args = func_get_args();
     740            $args = array_splice($args, 1);
     741            if ( !empty($args) )
     742                $string = vsprintf($string, $args);
     743        }
    738744        if ( empty($string) )
    739745            return;
Note: See TracChangeset for help on using the changeset viewer.