php - strip_tags removes allowed tags when within attributes -
for reason, php's strig_tags( ) function removing brackets tags explicitly allowed, when tags appear within attribute.
example:
<div data-contents="<p>hello!</p>"></div>
becomes
<div data-contents="phello!/p"></div>
i know, know. isn't practice.
regardless, ideas?
as warnings on man page state: **because strip_tags() not validate html, partial or broken tags can result in removal of more text/data expected.
if want embed html inside attribute, must encoded, e.g. should have <p>hello!</p>
instead.
strip tags "dumb" , remove looks tag, regardless of tag occurs in text, or if result in broken page or not.
Comments
Post a Comment