Make WordPress Core

Ticket #7875: 7875.8.diff

File 7875.8.diff, 1.2 KB (added by DD32, 16 years ago)
  • wp-admin/includes/class-wp-upgrader.php

     
    722722                if ( is_string($errors) ) {
    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        }
    729733
     
    731735                if ( isset( $this->upgrader->strings[$string]) )
    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;
    740746                show_message($string);