From 02a1fdacd7fb32d40b30ea52c07c07c7c414ee76 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 8 Nov 2011 15:38:06 -0800 Subject: strip duplicate code blocks bb2d* --- include/bb2diaspora.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include/bb2diaspora.php') diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 2331865ae..262b61ac0 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -149,13 +149,11 @@ function bb2diaspora($Text,$preserve_nl = false) { // Check for font change text // $Text = preg_replace("(\[font=(.*?)\](.*?)\[\/font\])","$2",$Text); - // Declare the format for [code] layout - $Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/is",'stripdcode_br_cb',$Text); + $Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/is",'stripdcode_br_cb',$Text); - // $CodeLayout = '$1'; // Check for [code] text - $Text = preg_replace("/\[code\](.*?)\[\/code\]/is","\t$1\n", $Text); + $Text = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/is","\t$2\n", $Text); -- cgit v1.2.3