From 1d3f1cee552ed6986e6109ad1e5df432d4c944f4 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Mon, 26 Nov 2001 14:07:33 +0000 Subject: Fixes various issues inc. bugs #485538, #485323 and an incorrect conversion of some accented chars (thanks Ashe for noting it) git-svn-id: file:///svn/phpbb/trunk@1453 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/post.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/post.php') diff --git a/phpBB/includes/post.php b/phpBB/includes/post.php index db77d05498..b43b055257 100644 --- a/phpBB/includes/post.php +++ b/phpBB/includes/post.php @@ -37,8 +37,10 @@ function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid if( $html_on ) { - $html_entities_match = array("#<#", "#>#", "#& #"); - $html_entities_replace = array("<", ">", "& "); + $html_entities_match = array("#&#", "#<#", "#>#"); + $html_entities_replace = array("&", "<", ">"); + + $message = preg_replace("#&([a-z0-9]+?);#i", "&\\1;", $message); $start_html = 1; @@ -81,8 +83,8 @@ function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid } else { - $html_entities_match = array("#<#", "#>#", "#& #"); - $html_entities_replace = array("<", ">", "& "); + $html_entities_match = array("#&#", "#<#", "#>#"); + $html_entities_replace = array("&", "<", ">"); $message = preg_replace($html_entities_match, $html_entities_replace, $message); } -- cgit v1.2.1