From 56777d417dd3fefd42e44db4f60377709fccdf5a Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 18 Nov 2005 13:47:42 +0000 Subject: WP Merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@440 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-inst/wp-includes/comment-functions.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'wp-inst/wp-includes/comment-functions.php') diff --git a/wp-inst/wp-includes/comment-functions.php b/wp-inst/wp-includes/comment-functions.php index 4cf7a47..85f7ba1 100644 --- a/wp-inst/wp-includes/comment-functions.php +++ b/wp-inst/wp-includes/comment-functions.php @@ -622,7 +622,8 @@ function pingback($content, $post_ID) { // We don't wanna ping first and second types, even if they have a valid foreach($post_links_temp[0] as $link_test) : - if ( !in_array($link_test, $pung) && url_to_postid($link_test) != $post_ID) : // If we haven't pung it already and it isn't a link to itself + if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself + && !is_local_attachment($link_test) ) : // Also, let's never ping local attachments. $test = parse_url($link_test); if (isset($test['query'])) $post_links[] = $link_test; @@ -753,6 +754,18 @@ function discover_pingback_server_uri($url, $timeout_bytes = 2048) { return false; } +function is_local_attachment($url) { + if ( !strstr($url, get_bloginfo('home') ) ) + return false; + if ( strstr($url, get_bloginfo('home') . '/?attachment_id=') ) + return true; + if ( $id = url_to_postid($url) ) { + $post = & get_post($id); + if ( 'attachment' == $post->post_status ) + return true; + } + return false; +} function wp_set_comment_status($comment_id, $comment_status) { global $wpdb; @@ -788,7 +801,6 @@ function wp_set_comment_status($comment_id, $comment_status) { } } - function wp_get_comment_status($comment_id) { global $wpdb; -- cgit