Wednesday, 7 August 2013

strip_tags removes allowed tags when within attributes

strip_tags removes allowed tags when within attributes

For some reason, PHP's strig_tags( ) function is removing brackets from
tags which are explicitly allowed, when those tags appear within an
attribute.
Example:
<div data-contents="<p>Hello!</p>"></div>
becomes
<div data-contents="pHello!/p"></div>
I know, I know. This isn't necessarily good practice.
Regardless, any ideas?

No comments:

Post a Comment