[wp-trac] [WordPress Trac] #44205: Trying to call a member function on a boolean value -

WordPress Trac noreply at wordpress.org
Wed May 23 13:28:06 UTC 2018


#44205: Trying to call a member function on a boolean value -
--------------------------+-----------------------------
 Reporter:  yrpwayne      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.9.6
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-----------------------------
 In wp-admin\includes\file.php on lines 1892-1895 you have:
 {{{#!php
 $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/

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44205>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list