From ad2b76ea294d29efbe1b1c68675784e48928dbdf Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Thu, 6 Sep 2001 16:48:15 +0000 Subject: [PATCH] Possible fix for bug #459075, please report any strange behaviour with this update git-svn-id: file:///svn/phpbb/trunk@994 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/posting.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index cd3e51e3fe..7ca8e626dc 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -30,6 +30,8 @@ include($phpbb_root_path . 'includes/bbcode.'.$phpEx); // Do some initial checks, set basic variables, // etc. // +$html_entities_match = array("#<#", "#>#", "#& #"); +$html_entities_replace = array("<", ">", "& "); $submit = ( isset($HTTP_POST_VARS['submit']) ) ? TRUE : 0; $cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? TRUE : 0; @@ -1667,7 +1669,7 @@ else $post_message = preg_replace("/\:[0-9a-z\:]*?\]/si", "]", $post_message); $post_message = str_replace("
", "\n", $post_message); - $post_message = undo_htmlspecialchars($post_message); + $post_message = preg_replace($html_entities_match, $html_entities_replace, $post_message); $post_message = preg_replace('##si', '</textarea>', $post_message); // @@ -1853,6 +1855,11 @@ if( $preview && !$error ) ); $template->pparse("preview"); + // + // Post preview output conversion + // + $post_message = preg_replace($html_entities_match, $html_entities_replace, $post_message); + } // // End preview output