WordPress.org

Make WordPress Core

Ticket #1452: xmlrpc.php.patch

File xmlrpc.php.patch, 1.6 KB (added by pombsd, 13 years ago)

Patch for both bugs mentioned

  • xmlrpc.php

    old new  
    2424                fclose($fp);
    2525        }
    2626        return true;
    27         }
     27}
    2828
    2929function starify($string) {
    3030        $i = strlen($string);
     
    543543          logIO('O', "Posted ! ID: $post_ID");
    544544
    545545          // FIXME: do we pingback always? pingback($content, $post_ID);
    546           trackback_url_list($content_struct['mt_tb_ping_urls'],$post_ID);
     546     $tb_list = $content_struct['mt_tb_ping_urls'];
     547     if (is_array($tb_list)) {
     548        $tb_list = implode(",", $tb_list);
     549     }
     550
     551          trackback_url_list($tb_list, $post_ID);
    547552
    548553          return strval($post_ID);
    549554        }
     
    614619          // We've got all the data -- post it:
    615620          $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt');
    616621
    617           $post_ID = wp_update_post($newpost);
    618           if (!$post_ID) {
     622          $aff_rows = wp_update_post($newpost);
     623          if (!$aff_rows) {
    619624            return new IXR_Error(500, 'Sorry, your entry could not be edited. Something wrong happened.');
    620625          }
    621626
    622627          logIO('O',"(MW) Edited ! ID: $post_ID");
    623628
    624629          // FIXME: do we pingback always? pingback($content, $post_ID);
    625           trackback_url_list($content_struct['mt_tb_ping_urls'], $post_ID);
     630     $tb_list = $content_struct['mt_tb_ping_urls'];
     631     if (is_array($tb_list)) {
     632        $tb_list = implode(",", $tb_list);
     633     }
     634
     635          trackback_url_list($tb_list, $post_ID);
    626636
    627637          return true;
    628638        }
     
    12701280
    12711281$wp_xmlrpc_server = new wp_xmlrpc_server();
    12721282
    1273 ?>
    1274  No newline at end of file
     1283?>