Upgrade/Install: Correct operator precedence for an error code in WP_Ajax_Upgrader_Skin::error().

Props jrf.
Fixes #47441.

git-svn-id: https://develop.svn.wordpress.org/trunk@45487 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-05-31 14:13:09 +00:00
parent af0c73b10b
commit 9172b9c16b

View File

@ -95,9 +95,9 @@ class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin {
}
}
// Count existing errors to generate an unique error code.
// Count existing errors to generate a unique error code.
$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 ) ) {
foreach ( $errors->get_error_codes() as $error_code ) {
$this->errors->add( $error_code, $errors->get_error_message( $error_code ), $errors->get_error_data( $error_code ) );