Possible Duplicate:
What do the ENT_HTML5, ENT_HTML401, … modifiers on html_entity_decode do?
When using htmlspecialchars to escape output that goes to an html attribute, I am wondering what flag is correct.
it seems that ENT_QUOTES
would be safer than ENT_COMPAT
because it cannot fail if someone accidently adds some code with single quoted attributes, but so why does ENT_COMPAT
exist? Is there a disadvantage to ENT_QUOTES
?
Also what are the security implications of using ENT_HTML5
, ENT_XHTML
or ENT_HTML401
or not setting one at all?