OPEN
includes/functions_post.php
FIND
// This function will prepare a posted message for entry into the database.
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)
{
global $board_config, $html_entities_match, $html_entities_replace;
// Clean up the message
$message = trim($message);
if ($html_on)
{
// If HTML is on, we try to make it safe
// This approach is quite agressive and anything that does not look like a valid tag
// is going to get converted to HTML entities
$message = stripslashes($message);
$html_match = '#<[^w<]*(w+)((?:"[^"]*"|'[^']*'|[^<>'"])+)?>#';
$matches = array();
$message_split = preg_split($html_match, $message);
preg_match_all($html_match, $message, $matches);
$message = '';
foreach ($message_split as $part)
{
$tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2]));
$message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag);
//$message .= preg_replace($html_entities_match, $html_entities_replace, $part) . $tag;
}
$message = addslashes($message);
$message = str_replace('"', '"', $message);
}
else
{
$message = preg_replace($html_entities_match, $html_entities_replace, $message);
}
return $message;
}
REPLACE WITH
// This function will prepare a posted message for entry into the database.
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)
{
return trim($message);
}