From 6d5dfea492372fe1bad3f9b0910d718759ec0f3f Mon Sep 17 00:00:00 2001 From: shish Date: Thu, 27 Nov 2008 07:17:52 +0000 Subject: [PATCH] only allow two consecutive newlines git-svn-id: file:///home/shish/svn/shimmie2/trunk@1115 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/bbcode/main.php | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/bbcode/main.php b/ext/bbcode/main.php index 50ad3838..8fe1f5b8 100644 --- a/ext/bbcode/main.php +++ b/ext/bbcode/main.php @@ -20,6 +20,7 @@ class BBCode implements Extension { $text = preg_replace("/\[url\]((?:https?|ftp|irc|mailto):\/\/.*?)\[\/url\]/s", "\\1", $text); $text = preg_replace("/\[\[([^\|\]]+)\|([^\]]+)\]\]/s", "\\2", $text); $text = preg_replace("/\[\[([^\]]+)\]\]/s", "\\1", $text); + $text = preg_replace("/\n\s*\n/", "\n\n", $text); $text = str_replace("\n", "\n
", $text); $text = preg_replace("/\[quote\](.*?)\[\/quote\]/s", "
\\1
", $text); $text = preg_replace("/\[quote=(.*?)\](.*?)\[\/quote\]/s", "Quoting \\1
\\2
", $text);