From: Pierre Habouzit (MadCoder Date: Sat, 1 Jan 2005 16:27:59 +0000 (+0000) Subject: separate signature with
X-Git-Tag: xorg/old~545 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=8d9897a165eaa2df78e8f4bfc4af2e7617337212;p=platal.git separate signature with
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-203 --- diff --git a/htdocs/banana/include/format.inc.php b/htdocs/banana/include/format.inc.php index 8ccb9e8..88cf935 100644 --- a/htdocs/banana/include/format.inc.php +++ b/htdocs/banana/include/format.inc.php @@ -142,14 +142,20 @@ function formatDisplayHeader($_header,$_text,$_spool) { * @return STRING HTML output */ function formatbody($_text) { - global $news; - $res ="\n\n"; - $res .= htmlentities(wrap($_text,"",$news['wrap']))."\n"; - $res = preg_replace("/(<|>|")/"," \\1 ",$res); - $res = preg_replace('/(["\[])?((https?|ftp|news):\/\/[a-z@0-9.~%$£µ&i#\-+=_\/\?]*)(["\]])?/i', - "\\1\\2\\4", $res); - $res = preg_replace("/ (<|>|") /","\\1",$res); - return $res."\n"; + global $news; + $res = "\n\n" . htmlentities(wrap($_text,"",$news['wrap']))."\n\n"; + $res = preg_replace("/(<|>|")/"," \\1 ",$res); + $res = preg_replace('/(["\[])?((https?|ftp|news):\/\/[a-z@0-9.~%$£µ&i#\-+=_\/\?]*)(["\]])?/i', "\\1\\2\\4", $res); + $res = preg_replace("/ (<|>|") /","\\1",$res); + + $parts = preg_split("/\n-- ?\n/", $res); + + if (count($parts) > 1) { + $sign = "
" . array_pop($parts);
+        return join("\n-- \n", $parts).$sign;
+    } else {
+        return $res;
+    }
 }
 
 /** contextual links