Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#44205 closed defect (bug) (duplicate)

Trying to call a member function on a boolean value -

Reported by: yrpwayne's profile yrpwayne Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.6
Component: Privacy Keywords:
Focuses: administration Cc:

Description

In wp-admin\includes\file.php on lines 1892-1895 you have:

$result = wp_mkdir_p( $exports_dir );
        if ( is_wp_error( $result ) ) {
                wp_send_json_error( $result->get_error_message() );
        }

wp_mkdir_p( <string> ); returns a Boolean which means wp_send_json_error( $result->get_error_message() ); is invalid.

I assume it should be wp_send_json_error( $result ); // Or maybe add a status code.
https://developer.wordpress.org/reference/functions/wp_send_json_error/

Change History (2)

#1 @birgire
7 years ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks @yrpwayne for the ticket, but this should be fixed in #44158 for the upcoming 4.9.7

#2 @SergeyBiryukov
7 years ago

  • Component changed from General to Privacy
  • Focuses administration added
Note: See TracTickets for help on using tickets.