In the upgrader, only print additional error data if it is a string.

As in [25576], we sometimes want to return additional data that is not necessarily meant for UI consumption.

see #25576.

Built from https://develop.svn.wordpress.org/trunk@25775


git-svn-id: http://core.svn.wordpress.org/trunk@25688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-10-14 20:20:10 +00:00
parent d68a80217f
commit 1516b990f1
1 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ class WP_Upgrader_Skin {
$this->feedback($errors);
} elseif ( is_wp_error($errors) && $errors->get_error_code() ) {
foreach ( $errors->get_error_messages() as $message ) {
if ( $errors->get_error_data() )
if ( $errors->get_error_data() && is_string( $errors->get_error_data() ) )
$this->feedback($message . ' ' . esc_html( $errors->get_error_data() ) );
else
$this->feedback($message);
@ -205,7 +205,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
if ( is_wp_error($error) ) {
foreach ( $error->get_error_messages() as $emessage ) {
if ( $error->get_error_data() )
if ( $error->get_error_data() && is_string( $error->get_error_data() ) )
$messages[] = $emessage . ' ' . esc_html( $error->get_error_data() );
else
$messages[] = $emessage;