mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
Default category and pingback check fixes.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c26724062a
commit
bdfab81fd0
19
xmlrpc.php
19
xmlrpc.php
@ -10,7 +10,6 @@ include_once(ABSPATH . WPINC . '/class-IXR.php');
|
|||||||
// error_reporting(0);
|
// error_reporting(0);
|
||||||
|
|
||||||
$post_default_title = ""; // posts submitted via the xmlrpc interface get that title
|
$post_default_title = ""; // posts submitted via the xmlrpc interface get that title
|
||||||
$post_default_category = 1; // posts submitted via the xmlrpc interface go into that category
|
|
||||||
|
|
||||||
$xmlrpc_logging = 0;
|
$xmlrpc_logging = 0;
|
||||||
|
|
||||||
@ -563,9 +562,9 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||||||
foreach ($catnames as $cat) {
|
foreach ($catnames as $cat) {
|
||||||
$post_category[] = get_cat_ID($cat);
|
$post_category[] = get_cat_ID($cat);
|
||||||
}
|
}
|
||||||
} else {
|
} else if ( !empty($catnames) ) {
|
||||||
$post_category[] = $post_default_category;
|
$post_category = array(get_cat_ID($catnames));
|
||||||
}
|
}
|
||||||
|
|
||||||
// We've got all the data -- post it:
|
// We've got all the data -- post it:
|
||||||
$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping');
|
$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping');
|
||||||
@ -611,14 +610,16 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||||||
$post_title = $content_struct['title'];
|
$post_title = $content_struct['title'];
|
||||||
$post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
|
$post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
|
||||||
$catnames = $content_struct['categories'];
|
$catnames = $content_struct['categories'];
|
||||||
|
|
||||||
|
$post_category = array();
|
||||||
|
|
||||||
if (is_array($catnames)) {
|
if (is_array($catnames)) {
|
||||||
foreach ($catnames as $cat) {
|
foreach ($catnames as $cat) {
|
||||||
$post_category[] = get_cat_ID($cat);
|
$post_category[] = get_cat_ID($cat);
|
||||||
}
|
}
|
||||||
} else {
|
} else if ( !empty($catnames) ) {
|
||||||
$post_category[] = $post_default_category;
|
$post_category = array(get_cat_ID($catnames));
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_excerpt = $content_struct['mt_excerpt'];
|
$post_excerpt = $content_struct['mt_excerpt'];
|
||||||
$post_more = $content_struct['mt_text_more'];
|
$post_more = $content_struct['mt_text_more'];
|
||||||
@ -824,7 +825,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||||||
// http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/
|
// http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/
|
||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
$blog_ID = $wpdb->escape($args[0]);
|
$blog_ID = $wpdb->escape($args[0]);
|
||||||
$user_login = $wpdb->escape($args[1]);
|
$user_login = $wpdb->escape($args[1]);
|
||||||
$user_pass = $wpdb->escape($args[2]);
|
$user_pass = $wpdb->escape($args[2]);
|
||||||
@ -1193,7 +1194,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||||||
|
|
||||||
logIO("O","(PB) URI='$pagelinkedto' ID='$post_ID' Found='$way'");
|
logIO("O","(PB) URI='$pagelinkedto' ID='$post_ID' Found='$way'");
|
||||||
|
|
||||||
$post = $wpdb->get_row("SELECT post_author FROM $wpdb->posts WHERE ID = '$post_ID'");
|
$post = get_post($post_ID);
|
||||||
|
|
||||||
if ( !$post ) // Post_ID not found
|
if ( !$post ) // Post_ID not found
|
||||||
return new IXR_Error(33, 'The specified target URI cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
|
return new IXR_Error(33, 'The specified target URI cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
|
||||||
|
Loading…
Reference in New Issue
Block a user