WordPress.org

Make WordPress Core

Ticket #47441: 47441.patch

File 47441.patch, 1.2 KB (added by jrf, 14 months ago)
  • src/wp-admin/includes/class-wp-ajax-upgrader-skin.php

    From d1b154840d6a004251a13cca6918ac272ebbf456 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Fri, 31 May 2019 07:01:56 +0200
    Subject: [PATCH] WP_Ajax_Upgrader_Skin Bug: "unique" error code is always 1
    
    ---
     src/wp-admin/includes/class-wp-ajax-upgrader-skin.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php b/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php
    index 12afb44e25..347a1b2cc3 100644
    a b class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin { 
    9797
    9898                        // Count existing errors to generate an unique error code.
    9999                        $errors_count = count( $this->errors->get_error_codes() );
    100                         $this->errors->add( 'unknown_upgrade_error_' . $errors_count + 1, $string );
     100                        $this->errors->add( 'unknown_upgrade_error_' . ( $errors_count + 1 ), $string );
    101101                } elseif ( is_wp_error( $errors ) ) {
    102102                        foreach ( $errors->get_error_codes() as $error_code ) {
    103103                                $this->errors->add( $error_code, $errors->get_error_message( $error_code ), $errors->get_error_data( $error_code ) );