]> git.mjollnir.org Git - s9y.git/commitdiff
fix trackbacks with "#" in it
authorgarvinhicking <garvinhicking>
Mon, 25 Apr 2005 10:15:28 +0000 (10:15 +0000)
committergarvinhicking <garvinhicking>
Mon, 25 Apr 2005 10:15:28 +0000 (10:15 +0000)
docs/NEWS
include/functions_trackbacks.inc.php

index abc8686ef7dcc698487c648b0ea5708741bfcb90..7be4632f05adeeb8de15823c4f4bbc8fb687035d 100644 (file)
--- 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)
index 711b047668d2243661219acf6e655835bdf33fb8..9b3abc08e13a2914de7a9ede52685d70e8d7c637 100644 (file)
@@ -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 '<div>&#8226; ' . sprintf(TRACKBACK_FAILED, TRACKBACK_NOT_FOUND) . '</div>';
         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 '<div>&#8226; ' . sprintf(TRACKBACK_FAILED, TRACKBACK_URI_MISMATCH) . '</div>';
             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 '<div>&#8226; ' . TRACKBACK_NO_DATA . '</div>';