Make WordPress Core

Ticket #28601: class-wp-xmlrpc-server.php.patch

File class-wp-xmlrpc-server.php.patch, 1.6 KB (added by dllh, 11 years ago)

Patches the xml-rpc server code to fix the fatal

  • wp-includes/class-wp-xmlrpc-server.php

     
    11011101                if ( ! $user = $this->login( $username, $password ) )
    11021102                        return $this->error;
    11031103
     1104                // convert the date field back to IXR form
     1105                if ( isset( $content_struct['post_date'] ) ) {
     1106                        $content_struct['post_date'] = $this->_convert_date( $content_struct['post_date'] );
     1107                }
     1108
     1109                // ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct,
     1110                // since _insert_post will ignore the non-GMT date if the GMT date is set
     1111                if ( isset( $content_struct['post_date_gmt'] ) ) {
     1112                        if ( $content_struct['post_date_gmt'] == '0000-00-00 00:00:00' || isset( $content_struct['post_date'] ) ) {
     1113                                unset( $content_struct['post_date_gmt'] );
     1114                        } else {
     1115                                $content_struct['post_date_gmt'] = $this->_convert_date( $content_struct['post_date_gmt'] );
     1116                        }
     1117                }
     1118
    11041119                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    11051120                do_action( 'xmlrpc_call', 'wp.newPost' );
    11061121
     
    11931208
    11941209                if ( isset( $post_data['ping_status'] ) && $post_data['ping_status'] != 'open' && $post_data['ping_status'] != 'closed' )
    11951210                        unset( $post_data['ping_status'] );
     1211                // Do some timestamp voodoo
    11961212
    1197                 // Do some timestamp voodoo
    11981213                if ( ! empty( $post_data['post_date_gmt'] ) ) {
    11991214                        // We know this is supposed to be GMT, so we're going to slap that Z on there by force
    12001215                        $dateCreated = rtrim( $post_data['post_date_gmt']->getIso(), 'Z' ) . 'Z';