Make WordPress Core

Ticket #22324: 22324.fix-xmlrpc.diff

File 22324.fix-xmlrpc.diff, 2.6 KB (added by markoheijnen, 12 years ago)

Be sure that post_author is a string when calling the XML-RPC

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

     
    628628                        'post_status'       => $post['post_status'],
    629629                        'post_type'         => $post['post_type'],
    630630                        'post_name'         => $post['post_name'],
    631                         'post_author'       => $post['post_author'],
     631                        'post_author'       => (string) $post['post_author'],
    632632                        'post_password'     => $post['post_password'],
    633633                        'post_excerpt'      => $post['post_excerpt'],
    634634                        'post_content'      => $post['post_content'],
     
    810810
    811811                $_page = array(
    812812                        'dateCreated'            => $page_date,
    813                         'userid'                 => $page->post_author,
     813                        'userid'                 => (string) $page->post_author,
    814814                        'page_id'                => $page->ID,
    815815                        'page_status'            => $page->post_status,
    816816                        'description'            => $full_page['main'],
     
    37513751                $content .= stripslashes($post_data['post_content']);
    37523752
    37533753                $struct = array(
    3754                         'userid'    => $post_data['post_author'],
     3754                        'userid'      => (string) $post_data['post_author'],
    37553755                        'dateCreated' => $this->_convert_date( $post_data['post_date'] ),
    37563756                        'content'     => $content,
    3757                         'postid'  => (string) $post_data['ID']
     3757                        'postid'      => (string) $post_data['ID']
    37583758                );
    37593759
    37603760                return $struct;
     
    38053805                        $content .= stripslashes($entry['post_content']);
    38063806
    38073807                        $struct[] = array(
    3808                                 'userid' => $entry['post_author'],
     3808                                'userid'      => (string) $entry['post_author'],
    38093809                                'dateCreated' => $post_date,
    3810                                 'content' => $content,
    3811                                 'postid' => (string) $entry['ID'],
     3810                                'content'     => $content,
     3811                                'postid'      => (string) $entry['ID'],
    38123812                        );
    38133813
    38143814                }
     
    46964696
    46974697                        $resp = array(
    46984698                                'dateCreated' => $post_date,
    4699                                 'userid' => $postdata['post_author'],
     4699                                'userid' => (string) $postdata['post_author'],
    47004700                                'postid' => $postdata['ID'],
    47014701                                'description' => $post['main'],
    47024702                                'title' => $postdata['post_title'],
     
    48104810
    48114811                        $struct[] = array(
    48124812                                'dateCreated' => $post_date,
    4813                                 'userid' => $entry['post_author'],
     4813                                'userid' => (string) $entry['post_author'],
    48144814                                'postid' => (string) $entry['ID'],
    48154815                                'description' => $post['main'],
    48164816                                'title' => $entry['post_title'],
     
    50315031
    50325032                        $struct[] = array(
    50335033                                'dateCreated' => $post_date,
    5034                                 'userid' => $entry['post_author'],
     5034                                'userid' => (string) $entry['post_author'],
    50355035                                'postid' => (string) $entry['ID'],
    50365036                                'title' => $entry['post_title'],
    50375037                                'post_status' => $entry['post_status'],