From 96fced0f3d226e9f9f33209827e7ccccaa71a31a Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Mon, 25 Apr 2005 10:15:28 +0000 Subject: [PATCH] fix trackbacks with "#" in it --- docs/NEWS | 3 ++- include/functions_trackbacks.inc.php | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index abc8686..7be4632 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -5,7 +5,8 @@ Version 0.9 () * Allow the serendipity_event_trackback additional trackbacks plugin to send trackbacks even if your entry did not contain at least one - link (garvinhicking) + link. Also fix not sending trackbacks containing "#" fragments + (garvinhicking) * Do not display Sidebar titles if they are not set for the bundled default, kubrick and wp templates (sidebar.tpl) (garvinhicking) diff --git a/include/functions_trackbacks.inc.php b/include/functions_trackbacks.inc.php index 711b047..9b3abc0 100644 --- a/include/functions_trackbacks.inc.php +++ b/include/functions_trackbacks.inc.php @@ -118,7 +118,7 @@ function _serendipity_send($loc, $data) { return $res; } -function serendipity_trackback_autodiscover($res, $loc, $url, $author, $title, $text) { +function serendipity_trackback_autodiscover($res, $loc, $url, $author, $title, $text, $loc2 = '') { if (!preg_match('@trackback:ping(\s*rdf:resource)?\s*=\s*["\'](https?:[^"\']+)["\']@i', $res, $matches)) { echo '
• ' . sprintf(TRACKBACK_FAILED, TRACKBACK_NOT_FOUND) . '
'; return false; @@ -127,7 +127,7 @@ function serendipity_trackback_autodiscover($res, $loc, $url, $author, $title, $ $trackURI = trim($matches[2]); if (preg_match('@dc:identifier\s*=\s*["\'](https?:[^\'"]+)["\']@i', $res, $test)) { - if ($loc != $test[1]) { + if ($loc != $test[1] && $loc2 != $test[1]) { echo '
• ' . sprintf(TRACKBACK_FAILED, TRACKBACK_URI_MISMATCH) . '
'; return false; } @@ -179,6 +179,7 @@ global $serendipity; } $parsed_loc = $u['scheme'] . '://' . $u['host'] . $port . $u['path']; + $res = ''; $fp = @fsockopen($u['host'], $u['port'], $err, $timeout); @@ -203,7 +204,7 @@ global $serendipity; } if (strlen($res) != 0) { - serendipity_trackback_autodiscover($res, $parsed_loc, $url, $author, $title, $text); + serendipity_trackback_autodiscover($res, $parsed_loc, $url, $author, $title, $text, $loc); serendipity_pingback_autodiscover($loc, $res); } else { echo '
• ' . TRACKBACK_NO_DATA . '
'; -- 2.39.5