]> git.mjollnir.org Git - s9y.git/commitdiff
some more backporting. the trackback thing should work in 0.8 without any issues...
authornohn <nohn>
Mon, 25 Apr 2005 11:23:02 +0000 (11:23 +0000)
committernohn <nohn>
Mon, 25 Apr 2005 11:23:02 +0000 (11:23 +0000)
docs/NEWS
include/functions_trackbacks.inc.php
plugins/serendipity_event_bbcode/serendipity_event_bbcode.php

index 052d7742559d0209b15dfc0a40e584079645e0d4..8122598c79dae3d133b78ea03a7e87cfaddd63b8 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,26 +3,31 @@
 Version 0.8.1 ()
 ------------------------------------------------------------------------
 
-     * Do not display Sidebar titles if they are not set for the bundled 
-       default, kubrick and wp templates (sidebar.tpl) (garvinhicking)
+    * Allow the serendipity_event_trackback additional trackbacks plugin
+      to send trackbacks even if your entry did not contain at least one
+      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)
 
-     * Adjusted checking for "convert" binary in installation for
-       Windows servers. Thanks to BobRock! (garvinhicking)
+    * Adjusted checking for "convert" binary in installation for
+      Windows servers. Thanks to BobRock! (garvinhicking)
  
-     * BBCode plugin: Allow ~ and ! URL characters (garvinhicking)
-     
-     * Added romanian translation by Alexandru Szasz
+    * BBCode plugin: Allow =, ~ and ! URL characters (garvinhicking)
+    
+    * Added romanian translation by Alexandru Szasz
  
-     * Some IIS webserver compatibility for $_SERVER variables. This should
-       ensure most basic operations. (garvinhicking)
+    * Some IIS webserver compatibility for $_SERVER variables. This should
+      ensure most basic operations. (garvinhicking)
         
-     * RSS feed does no longer initialize a session and thus now causes
-       proper cachability for Conditional Get (garvinhicking)
+    * RSS feed does no longer initialize a session and thus now causes
+      proper cachability for Conditional Get (garvinhicking)
 
-     * Fix issues on Windows installations: %T strftime-Option not known
-       when saving a plugin and emitting timestamp (was empty),
-       redirecting to a wrong URL for installation with '\' instead of
-       '/' path indicators. Thanks to Hendy Irawan! (garvinhicking)
+    * Fix issues on Windows installations: %T strftime-Option not known
+      when saving a plugin and emitting timestamp (was empty),
+      redirecting to a wrong URL for installation with '\' instead of
+      '/' path indicators. Thanks to Hendy Irawan! (garvinhicking)
 
 Version 0.8 (April, 15th 2005)
 ------------------------------------------------------------------------
index d6c0518fd1b7af790f1325778422ae5b2acb49e4..b73a0cdb6443ca409538d2247936d73d2ccabf53 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;
         }
@@ -203,7 +203,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>';
@@ -312,12 +312,12 @@ function serendipity_handle_references($id, $author, $title, $text) {
     global $serendipity;
 
     if (!preg_match_all('@<a[^>]+?href\s*=\s*["\']?([^\'" >]+?)[ \'"][^>]*>(.+?)</a>@i', $text, $matches)) {
-        return;
+        $matches = array(0 => array(), 1 => array());
+    } else {
+        // remove full matches
+        array_shift($matches);
     }
 
-    // remove full matches
-    array_shift($matches);
-
     // Make trackback URL
     $url = serendipity_archiveURL($id, $title, 'baseURL');
 
index ebebf19e9c91868010481581c4225095b4f5dce3..f909ea13f16ebd2f07aa7f4da5ddd7f77d5b5088 100644 (file)
@@ -74,7 +74,7 @@ class serendipity_event_bbcode extends serendipity_event
         $pattern_mail  = '([\.\-\+~@_0-9a-z]+?)';
 
         // Only allow strings occuring in URLs: &;?:.-_@/, 0-9, a-z
-        $pattern_url   = '([@!~\?:&;0-9a-z#\.\-_\/]+?)';
+        $pattern_url   = '([@!=~\?:&;0-9a-z#\.\-_\/]+?)';
 
         // Disallow possibly evil HTML characters which may lead to Javascript XSS: '"();
         $pattern_query = '([^"\'\(\);]+?)';