summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-includes/comment-functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-18 13:47:42 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-18 13:47:42 +0000
commit56777d417dd3fefd42e44db4f60377709fccdf5a (patch)
tree163d1422f805827f7ba408260ccd9d9aaa6c5ea7 /wp-inst/wp-includes/comment-functions.php
parent2b56b90f06b0018f0dba866e2d799cda640d9597 (diff)
downloadwordpress-mu-56777d417dd3fefd42e44db4f60377709fccdf5a.tar.gz
wordpress-mu-56777d417dd3fefd42e44db4f60377709fccdf5a.tar.xz
wordpress-mu-56777d417dd3fefd42e44db4f60377709fccdf5a.zip
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@440 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/comment-functions.php')
-rw-r--r--wp-inst/wp-includes/comment-functions.php16
1 files changed, 14 insertions, 2 deletions
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 <link/>
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;