From f3014e4e1ec3aac4c2035721a10d85171fcfafae Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 27 Jan 2012 12:24:38 +0000 Subject: [PATCH] less regex --- ext/bbcode/main.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/bbcode/main.php b/ext/bbcode/main.php index 328d9dba..72eec4e8 100644 --- a/ext/bbcode/main.php +++ b/ext/bbcode/main.php @@ -133,7 +133,8 @@ class BBCode extends FormatterExtension { # at the end of this function, the only code! blocks should be # the ones we've added -- others may contain malicious content, # which would only appear after decoding - $text = preg_replace("/\[code!\](.*?)\[\/code!\]/s", "[code]\\1[/code]", $text); + $text = str_replace("[code!]", "[code]", $text); + $text = str_replace("[/code!]", "[/code]", $text); $l1 = strlen("[code]"); $l2 = strlen("[/code]");