msg# 1
what's the difference between using this method and php native function htmlspecialchars_decode()
or is this just for php 4 backward compatibility?
Votes:8
Average:10.00
msg# 1.1
hi vaughan.
htmlspecialchars_decode() needs PHP5.
We have to write codes working with both PHP4 and PHP5
Votes:10
Average:10.00
msg# 1.2
ok thanks :)
on a sidenote: we also discovered when using UTF-8 charsets fully, we ran into a few small issues with icms, which will affect xoops aswell.
in certain conditions, it is not enough to just use htmlspecialchars. but you also need to set which characterset you are using aswell.
as default htmlspecialchars encodes with ISO charset, for utf-8 you need to specify utf-8
example $text = htmlspecialchars($text, ENT_QUOTES, _CHARSET);
especially with function htmlSpecialChars() in xoops textsanitizer
Votes:11
Average:10.00
msg# 1.2.1
hi vaughan.
Quote:
on a sidenote: we also discovered when using UTF-8 charsets fully, we ran into a few small issues with icms, which will affect xoops aswell.
in certain conditions, it is not enough to just use htmlspecialchars. but you also need to set which characterset you are using aswell.
Which conditions?
As long as I read the source code of PHP in ext/standard/html.c, the third parameter -charset- looks almost non-sense.
And I've never experienced the trouble the charset for htmlspecialchars().
Votes:10
Average:10.00
msg# 1.3
we had trouble with some russian languages using utf-8 with the textsanitizer. and we had to add the charset to the end of function htmlSpecialChars() in order to solve it. this could have been caused through various server configs though, because some of us couldn't replicate the issue ourselves.
Votes:10
Average:10.00
msg# 1.3.1
hi vaughan.
Quote:
we had trouble with some russian languages using utf-8 with the textsanitizer. and we had to add the charset to the end of function htmlSpecialChars() in order to solve it. this could have been caused through various server configs though, because some of us couldn't replicate the issue ourselves.
hmmm...
Certainly, I don't know russian encodings at all.
But, _CHARSET is just 'UTF-8' for russian utf8.
I cannot understand what is wrong about that.
Votes:10
Average:10.00
msg# 1.4
me neither. initially we thought it was html purifier causing the problem, but after looking at the function, html purifier was not used at all, so it had to be with that function. the only difference i could see was on php.net they mentioned to set the charset if you use utf-8 encoding. was worth a try anyway and solved the problem in our case.
Votes:10
Average:10.00
msg# 1.4.1
hi vaughan.
hmmm..
It sounds strange.
We -Japanese- had used UTF-8 with htmlspecialchars() some years ago.
But we've never met troubles about the third parameter.
(Always blank)
Does Russian HTML use some specialcharacters other than <>'"& ??
# If they uses UTF-7, I can understand it though.
Votes:10
Average:10.00
msg# 1.5
not sure to be fair. but they may do, i will try to find out.
I thought it strange too as i am aware that you have been using utf-8 for a long while and didn't have these problems.
this however could also be related to us being all PHP 5 now and icms will not work on PHP4.
If I ever discover exactly what was causing it, i'll be sure to let you know :)
Votes:11
Average:10.00
msg# 1.5.1
hi vaughan.
Thank you for your kindness.
Votes:8
Average:8.75