From facd75bc44ec62b76f63c64158d094ab8ef09d1f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 1 Mar 2004 15:24:26 +0000 Subject: [PATCH] small fix for html replacement git-svn-id: file:///svn/phpbb/trunk@4849 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 34 +++++++++++----------------- phpBB/includes/message_parser.php | 2 +- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 26c81cc9d5..23bcbd25d4 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -101,10 +101,6 @@ function format_display(&$message, &$signature, $uid, $siguid, $html, $bbcode, $ $message = smilie_text($message, !$smilies); // Replace naughty words such as farty pants -/* if (sizeof($censors)) - { - $message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$censors['match'], \$censors['replace'], '\\0')", '>' . $message . '<'), 1, -1)); - }*/ $message = str_replace("\n", '
', censor_text($message)); // Signature @@ -115,10 +111,6 @@ function format_display(&$message, &$signature, $uid, $siguid, $html, $bbcode, $ $bbcode->bbcode_second_pass($signature, $siguid); $signature = smilie_text($signature); -/* if (sizeof($censors)) - { - $signature = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$censors['match'], \$censors['replace'], '\\0')", '>' . $signature . '<'), 1, -1)); - }*/ $signature = str_replace("\n", '
', censor_text($signature)); } else @@ -541,19 +533,6 @@ function decode_text(&$message, $bbcode_uid) $message = ($bbcode_uid) ? str_replace($search, $replace, $message) : str_replace('
', "\n", $message); - // HTML - if ($config['allow_html_tags']) - { - // If $html is true then "allowed_tags" are converted back from entity - // form, others remain - $allowed_tags = split(',', $config['allow_html_tags']); - - if (sizeof($allowed_tags)) - { - $message = preg_replace('#\<(\/?)(' . str_replace('*', '.*?', implode('|', $allowed_tags)) . ')\>#is', '<$1$2>', $message); - } - } - $match = array( '#.*?#', '#.*?#', @@ -574,6 +553,19 @@ function decode_text(&$message, $bbcode_uid) $message = preg_replace($match, $replace, $message); + // HTML + if ($config['allow_html_tags']) + { + // If $html is true then "allowed_tags" are converted back from entity + // form, others remain + $allowed_tags = split(',', $config['allow_html_tags']); + + if (sizeof($allowed_tags)) + { + $message = preg_replace('#\<(\/?)(' . str_replace('*', '.*?', implode('|', $allowed_tags)) . ')\>#is', '<$1$2>', $message); + } + } + return; } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 9fc85b683f..364855ebb8 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -100,7 +100,7 @@ class parse_message // Parse URL's $this->magic_url($url); - + return implode('
', $this->warn_msg); }