Comments refactoring and cleanup

git-svn-id: https://develop.svn.wordpress.org/trunk@1964 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg
2004-12-16 02:57:05 +00:00
parent 459c45d572
commit b39c4f8273
15 changed files with 956 additions and 998 deletions

View File

@@ -1218,12 +1218,11 @@ class wp_xmlrpc_server extends IXR_Server {
$original_pagelinkedfrom = $pagelinkedfrom;
$pagelinkedfrom = addslashes($pagelinkedfrom);
$original_title = $title;
$title = addslashes(strip_tags(trim($title)));
// Check if the entry allows pings
if( !check_comment($title, '', $pagelinkedfrom, $context, $user_ip, $user_agent) ) {
return new IXR_Error(49, 'Pingbacks not allowed on this entry.');
}
$pingstatus = $wpdb->get_var("SELECT ping_status FROM $wpdb->posts WHERE ID = $tb_id");
if ('open' != $pingstatus)
trackback_response(1, 'Sorry, trackbacks are closed for this item.');
$comment_post_ID = $post_ID;
$comment_author = $title;
@@ -1234,10 +1233,7 @@ class wp_xmlrpc_server extends IXR_Server {
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type');
wp_new_comment($commentdata);
$comment_ID = $wpdb->insert_id;
do_action('pingback_post', $comment_ID);
do_action('pingback_post', $wpdb->insert_id);
return "Pingback from $pagelinkedfrom to $pagelinkedto registered. Keep the web talking! :-)";
}