From af779a4720628b7ebabc23c67ea3af2459ee5170 Mon Sep 17 00:00:00 2001 From: brockhaus Date: Wed, 22 Aug 2007 17:57:57 +0000 Subject: [PATCH] pingback fetchData: Retreive content from first

tag, if found in order to have the article content instead of menu structure as content. If no

tag is found, the tag is the starting point to fetch content. --- include/functions_trackbacks.inc.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/functions_trackbacks.inc.php b/include/functions_trackbacks.inc.php index 315426b..cb9dd1f 100644 --- a/include/functions_trackbacks.inc.php +++ b/include/functions_trackbacks.inc.php @@ -510,10 +510,16 @@ function fetchPingbackData( &$comment) { $comment['title'] = strip_tags($matches[1]); } + // Try to get content from first

tag on: + if (preg_match('@]*>(.*?)@is',$fContent,$matches)) { + $body = $matches[1]; + } + if (empty($body) && preg_match('@]*>(.*?)@is',$fContent,$matches)){ + $body = $matches[1]; + } // Get a part of the article - if (preg_match('@]*>(.*?)@is',$fContent,$matches)) { - - $body = strip_tags($matches[1]); + if (!empty($body)) { + $body = strip_tags($body); //TODO: Serendipity comes into trouble wit html_entity_decode and "Umlaute" $body = str_replace(array(" "),array(' '),$body); -- 2.39.5