Topic: problems with html entities
I have < in a database (posts table, message field), but when this gets displayed, it is displayed as <..
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 bug reports → problems with html entities
I have < in a database (posts table, message field), but when this gets displayed, it is displayed as <..
this is the problem: function pun_htmlspecialchars($str)
Hmm, what do you mean? You just posted < here and it works. It only fails in your forum?
no, there is a bug... when I converted phpBB into PunBB, there was < sign converted as < -- BUT, when it is displayed, it is not displayed as <, but rather as <, because < gets converted into <
here's the fix:
function pun_htmlspecialchars($str)
{
$str = preg_replace('/&(?!#[0-9]+);/s', '&', $str);
$str = str_replace(array('<', '>', '"'), array('<', '>', '"'), $str);
return $str;
}
That is the way it should be. If the database contains <, the forum should display just that, not the character the entity represents.
ok, in that case, it's the *real problem* with phpBB -> PunBB conversion
Yes.
PunBB Forums → PunBB 1.2 bug reports → problems with html entities
Powered by PunBB, supported by Informer Technologies, Inc.