Make WordPress Core

Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#40873 closed defect (bug) (invalid)

Fatal Error from class-wp-ajax-upgrader-skin.php file

Reported by: bappidgreat's profile 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)

class-wp-ajax-upgrader-skin.diff (603 bytes) - added by bappi.d.great 8 years ago.
class-wp-ajax-upgrader-skin.diff patch file

Download all attachments as: .zip

Change History (7)

@bappi.d.great
8 years ago

class-wp-ajax-upgrader-skin.diff patch file

#1 @bappi.d.great
8 years ago

I have attached a patch.

#2 @bappi.d.great
8 years ago

  • Keywords has-patch added

#3 @bappi.d.great
8 years ago

  • Component changed from General to Upgrade/Install

#4 @bappi.d.great
7 years ago

  • Severity changed from normal to critical

#5 @afragen
6 years ago

  • Keywords close added
  • Resolution set to invalid
  • Status changed from new to closed

This was fixed in r41157

#6 @desrosj
6 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.