Fix infinite loop if quotation reach last line of the post
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Wed, 2 Aug 2006 18:44:33 +0000 (18:44 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:06 +0000 (00:35 +0100)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@129 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/misc.inc.php

index df81a6d..ccc309b 100644 (file)
@@ -626,7 +626,7 @@ function formatbody($_text, $format='plain', $flowed=false)
         $sign  = '<hr style="width: 100%; margin: 1em 0em; " />';
     } else {
         while (preg_match("@(^|<pre>|\n)&gt;@i", $res)) {
-            $res  = preg_replace("@(^|<pre>|\n)((&gt;[^\n]*\n)+)@ie",
+            $res  = preg_replace("@(^|<pre>|\n)((&gt;[^\n]*(?:\n|$))+)@ie",
                 "'\\1</pre><blockquote><pre>'"
                 ." . replaceQuotes('\\2')"
                 ." . '</pre></blockquote><pre>'",