diff --git a/include/functions_trackbacks.inc.php b/include/functions_trackbacks.inc.php index d55d2208..1429a2b5 100644 --- a/include/functions_trackbacks.inc.php +++ b/include/functions_trackbacks.inc.php @@ -53,22 +53,30 @@ function serendipity_pingback_is_success($resp) { * Perform a HTTP query for autodiscovering a pingback URL * * @access public - * @param string (deprecated) The URL to try autodiscovery - * @param string The response of the original URL + * @param string The URL to try autodiscovery + * @param string The HTML of the source URL + * @param string The URL of our blog article * @return */ -function serendipity_pingback_autodiscover($loc, $body) { +function serendipity_pingback_autodiscover($loc, $body, $url=null) { global $serendipity; + + // This is the old way, sending pingbacks, for downward compatibility. + // But this is wrong, as it does link from the main blog URL instead of the article URL + if (!isset($url)) { + $url = $serendipity['baseURL']; + } + if (!empty($_SERVER['X-PINGBACK'])) { $pingback = $_SERVER['X-PINGBACK']; } elseif (preg_match('@@i', $body, $matches)) { $pingback = $matches[1]; } else { echo '