From: nohn Date: Mon, 25 Apr 2005 11:23:02 +0000 (+0000) Subject: some more backporting. the trackback thing should work in 0.8 without any issues... X-Git-Tag: 0.8.1~29 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=65a07152208e720c8f121fdc2f1365583a2e333d;p=s9y.git some more backporting. the trackback thing should work in 0.8 without any issues. garvin? --- diff --git a/docs/NEWS b/docs/NEWS index 052d774..8122598 100644 --- 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) ------------------------------------------------------------------------ diff --git a/include/functions_trackbacks.inc.php b/include/functions_trackbacks.inc.php index d6c0518..b73a0cd 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; } @@ -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 '
• ' . TRACKBACK_NO_DATA . '
'; @@ -312,12 +312,12 @@ function serendipity_handle_references($id, $author, $title, $text) { global $serendipity; if (!preg_match_all('@]+?href\s*=\s*["\']?([^\'" >]+?)[ \'"][^>]*>(.+?)@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'); diff --git a/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php b/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php index ebebf19..f909ea1 100644 --- a/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php +++ b/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php @@ -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 = '([^"\'\(\);]+?)';