From f09a82268f146f0c22a3a38ad0a88e999234fa5d Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sun, 25 Oct 2015 17:30:51 +0000 Subject: [PATCH] Ignore self pings --- plugins/Linkback/lib/util.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/Linkback/lib/util.php b/plugins/Linkback/lib/util.php index 8f8388a3d2..94f0d992f4 100644 --- a/plugins/Linkback/lib/util.php +++ b/plugins/Linkback/lib/util.php @@ -5,6 +5,13 @@ function linkback_lenient_target_match($body, $target) { } function linkback_get_source($source, $target) { + // Check if we are pinging ourselves and ignore + $localprefix = common_config('site', 'server') . '/' . common_config('site', 'path'); + if(linkback_lenient_target_match($source, $localprefix)) { + common_debug('Ignoring self ping from ' . $source . ' to ' . $target); + return NULL; + } + $request = HTTPClient::start(); try {