Upgrade/Install: In `WP_Ajax_Upgrader_Skin`, call `::get_error_codes()` method on a `WP_Error` object `$this->errors` instead of a string variable `$errors`.

Props yrpwayne.
Fixes #41449.

git-svn-id: https://develop.svn.wordpress.org/trunk@41157 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-07-26 13:38:21 +00:00
parent e814f49f74
commit f3368725ac
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin {
} }
// Count existing errors to generate an unique error code. // Count existing errors to generate an unique error code.
$errors_count = count( $errors->get_error_codes() ); $errors_count = count( $this->errors->get_error_codes() );
$this->errors->add( 'unknown_upgrade_error_' . $errors_count + 1 , $string ); $this->errors->add( 'unknown_upgrade_error_' . $errors_count + 1 , $string );
} elseif ( is_wp_error( $errors ) ) { } elseif ( is_wp_error( $errors ) ) {
foreach ( $errors->get_error_codes() as $error_code ) { foreach ( $errors->get_error_codes() as $error_code ) {