From: garvinhicking Date: Mon, 2 May 2005 12:31:41 +0000 (+0000) Subject: allow plugins to send trackbacks despite missing RDF metadata X-Git-Tag: 0.9~484 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9b6ab5f5ddf76679a6d0a917bcf626ce46d89c05;p=s9y.git allow plugins to send trackbacks despite missing RDF metadata --- diff --git a/docs/NEWS b/docs/NEWS index b28667e..382c29d 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,10 @@ Version 0.9 () ------------------------------------------------------------------------ + * Added new event hook to the trackback sending facility so that + plugins like serendipity_event_trackback (additional_plugins) + can send trackbacks to Blogs without RDF-metadata (garvinhicking) + * Allow to view and fetch multiple categories. Categories plugin can allow viewers to select multiple categories to view. (garvinhicking) diff --git a/include/functions_trackbacks.inc.php b/include/functions_trackbacks.inc.php index 9b3abc0..3c4a153 100644 --- a/include/functions_trackbacks.inc.php +++ b/include/functions_trackbacks.inc.php @@ -120,8 +120,14 @@ function _serendipity_send($loc, $data) { 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; + $matches = array(); + serendipity_plugin_api::hook_event('backend_trackback_check', $matches, $loc); + + // Plugins may say that a URI is valid, in situations where a blog has no valid RDF metadata + if (empty($matches[2])) { + echo '
• ' . sprintf(TRACKBACK_FAILED, TRACKBACK_NOT_FOUND) . '
'; + return false; + } } $trackURI = trim($matches[2]);