From 5107b7aafa77fab8533c794ab41d54e5efc8e9b7 Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Sun, 20 Apr 2003 20:30:01 +0000 Subject: First-pass syntax highlightning. Will fix quotes later git-svn-id: file:///svn/phpbb/trunk@3901 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/bbcode.php | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'phpBB/includes/bbcode.php') diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index c34092f35c..6d73e470a8 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -70,7 +70,6 @@ class bbcode } } - if (count($str['search'])) { $message = str_replace($str['search'], $str['replace'], $message); @@ -307,38 +306,11 @@ class bbcode function bbcode_second_pass_code($type, $code) { - $code = stripslashes(str_replace("\r\n", "\n", $code)); + $code = stripslashes($code); switch ($type) { case 'php': - $str_from = array('<', '>', '"', ':', '[', ']', '(', ')', '{', '}', '.', '@'); - $str_to = array('<', '>', '"', ':', '[', ']', '(', ')', '{', '}', '.', '@'); - - $code = str_replace($str_to, $str_from, $code); - - $remove_tags = FALSE; - if (!preg_match('/\<\?.*?\?\>/is', $code)) - { - $remove_tags = TRUE; - $code = ""; - } - - ob_start(); - highlight_string($code); - $code = ob_get_contents(); - ob_end_clean(); - - if ($remove_tags) - { - $code = preg_replace('!^[\n\r\s\t]*[\n\r\s\t]*()<\?php (.*)\?>[\n\r\s\t]*()[\n\r\s\t]*[\n\r\s\t]*!is', '\1\2\3', $code); - } - else - { - $code = preg_replace('!^[\n\r\s\t]*[\n\r\s\t]*(.*)[\n\r\s\t]*[\n\r\s\t]*!is', '\1', $code); - } - break; - default: $code = str_replace("\t", '   ', $code); $code = str_replace(' ', '  ', $code); -- cgit v1.2.1