From 29434a730ab0f07824e7ebf40a1fc4269c21d2a3 Mon Sep 17 00:00:00 2001 From: dairiki Date: Fri, 7 Mar 2003 21:52:34 +0000 Subject: [PATCH] Wups. Didn't save the last of the previous changes before commit. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@2714 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/display.php | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/lib/display.php b/lib/display.php index 6aa7847b1..b263016ed 100644 --- a/lib/display.php +++ b/lib/display.php @@ -1,44 +1,9 @@ . - * - * Use the first paragraph in the page which contains at least two - * sentences. - * - * @see http://www.usemod.com/cgi-bin/mb.pl?MeatballWikiSuggestions - */ -function GleanDescription ($rev) { - $two_sentences - = pcre_fix_posix_classes("/[.?!]\s+[[:upper:])]" - . ".*" - . "[.?!]\s*([[:upper:])]|$)/sx"); - // Escape strings - $content = preg_replace("/(['\"])/", "\$1", $rev->getPackedContent()); - - // Iterate through paragraphs. - while (preg_match('/(?: ^ \w .* $ \n? )+/mx', $content, $m)) { - $paragraph = $m[0]; - - // Return paragraph if it contains at least two sentences. - if (preg_match($two_sentences, $paragraph)) { - return preg_replace("/\s*\n\s*/", " ", trim($paragraph)); - } - - $content = substr(strstr($content, $paragraph), strlen($paragraph)); - } - return ''; -} - /** * Extract keywords from Category* links on page. */ -- 2.45.0