#40873 closed defect (bug) (invalid)
Fatal Error from class-wp-ajax-upgrader-skin.php file
Reported by: | bappi.d.great | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | critical | Version: | |
Component: | Upgrade/Install | Keywords: | has-patch close |
Focuses: | Cc: |
Description
In the file /wp-admin/includes/class-wp-ajax-upgrader-skin.php line no 86:
public function error( $errors ) { if ( is_string( $errors ) ) { $string = $errors; if ( ! empty( $this->upgrader->strings[ $string ] ) ) { $string = $this->upgrader->strings[ $string ]; } if ( false !== strpos( $string, '%' ) ) { $args = func_get_args(); $args = array_splice( $args, 1 ); if ( ! empty( $args ) ) { $string = vsprintf( $string, $args ); } } // Count existing errors to generate an unique error code. $errors_count = count( $errors->get_error_codes() ); $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 ) ); } } $args = func_get_args(); call_user_func_array( array( $this, 'parent::error' ), $args ); }
Here the line $errors_count = count( $errors->get_error_codes() );
will run if it passes if ( is_string( $errors ) )
condition. But if $errors
is string, then how can it be treated as object in $errors->get_error_codes()
? Should not it be $this->errors->get_error_codes()
?
Attachments (1)
Change History (7)
Note: See
TracTickets for help on using
tickets.
class-wp-ajax-upgrader-skin.diff patch file