2010-06-17, 09:32 PM
For technical reasons, I'm trying to replace the Apostrophe within post messages with '
I just put the replace inside the function htmlspecialchars_uni($message), but that didn't work
Thanks in advance.
---
OK, I've just realized that I could use the parse_message_start hook. So problem solved
---
p.d. Just notice that there's a bug in MyBB. The second apostrophe should read ' ; (without the space)
I just put the replace inside the function htmlspecialchars_uni($message), but that didn't work
function htmlspecialchars_uni($message)
{
$message = preg_replace("#&(?!\#[0-9]+;)#si", "&", $message); // Fix & but allow unicode
$message = str_replace("<", "<", $message);
$message = str_replace(">", ">", $message);
$message = str_replace("'", "'", $message);
$message = str_replace("\"", """, $message);
return $message;
}
Did I miss some cache that affects? Or where should I do the replacement?Thanks in advance.
---
OK, I've just realized that I could use the parse_message_start hook. So problem solved
---
p.d. Just notice that there's a bug in MyBB. The second apostrophe should read ' ; (without the space)