From 8d85b6bf9208e888b95d01a045df9a40e4095f8e Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Thu, 12 Jul 2007 13:55:23 +0000 Subject: [PATCH] Grischa and Garvin proudly present: The REAL(tm) solution. :) --- docs/NEWS | 7 ++----- include/functions_trackbacks.inc.php | 12 ++++++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index db2f2d5..2b808dc 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,11 +3,8 @@ Version 1.3 () ------------------------------------------------------------------------ - * Made trackback/pingback functionality independend from link text. - Only the link url is relevant now. Now dupe links in entries are - not trackbacked/pingbacked twice and images w/o ALT attribute or - links with changed text won't be trackbacked again after resaving - the article. (brockhaus) + * Trackbacks to links without a description now get properly + evaluated. (brockhaus) * serendipity_plugin_comments now also supports Favatars in combination with serendipity_event_gravatar instead of diff --git a/include/functions_trackbacks.inc.php b/include/functions_trackbacks.inc.php index 1429a2b..e4dbb4e 100644 --- a/include/functions_trackbacks.inc.php +++ b/include/functions_trackbacks.inc.php @@ -248,9 +248,6 @@ global $serendipity; return; // Trackbacks to HTTPS URLs can only be performed with openssl activated } - echo '
• '. sprintf(TRACKBACK_CHECKING, $loc) .'
'; - flush(); - if (empty($u['port'])) { $u['port'] = 80; $port = ''; @@ -265,10 +262,13 @@ global $serendipity; $parsed_loc = $u['scheme'] . '://' . $u['host'] . $port . $u['path']; if (preg_match('@\.(jpe?g|aiff?|gif|png|pdf|doc|rtf|wave?|mp2|mp4|mpe?g3|mpe?g4|divx|xvid|bz2|mpe?g|avi|mp3|xl?|ppt|pps|xslt?|xsd|zip|tar|t?gz|swf|rm|ram?|exe|mov|qt|midi?|qcp|emf|wmf|snd|pmg|w?bmp|gcd|mms|ogg|ogm|rv|wmv|wma|jad|3g?|jar)$@i', $u['path'])) { - echo '
• ' . TRACKBACK_NO_DATA . '
'; + // echo '
• ' . TRACKBACK_NO_DATA . '
'; return; } + echo '
• '. sprintf(TRACKBACK_CHECKING, $loc) .'
'; + flush(); + require_once S9Y_PEAR_PATH . 'HTTP/Request.php'; $options = array('allowRedirects' => true, 'maxRedirects' => 5, 'method' => 'GET'); serendipity_plugin_api::hook_event('backend_http_request', $options, 'trackback_detect'); @@ -573,6 +573,10 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f if ($debug && is_string($row)) { echo $row . "
\n"; } + + if (empty($names[$i])) { + $names[$i] = $locations[$i]; + } if ($row[0] > 0 && isset($saved_references[$locations[$i] . $names[$i]])) { if ($debug) echo "Found references for $id, skipping rest
\n"; -- 2.39.5