How to avoid encoding of &, <, > with CHtmlPurifier

When using CHtmlPurifier in rules, it encodes special characters such as & < >. How to avoid it?

The way i am using this is


array('name','filter','filter'=>array($obj=new CHtmlPurifier(),'purify'))

If i give the input as


Abc & Mno < Yyz

the output is converted to


Abc &amp; Mno &lt; Yyz

How to avoid this behavior and retain the special characters in input?

The way I am doing right now is to define another rule that runs html_entity_decode on the purified data. But is this the right way or is there some other way?

yes, html_entity_decode is the answer.

Hi,

I was facing same problem of how to avoid encoding of < > &.

This post is really helpful for me.

The only confusion is:

How to define another rule that runs html_entity_decode on the purified data?

Can anyone please guide me.

Thanks

My mistake I was able to define rule like this:

array(‘title, description’, ‘filter’,‘filter’=> ‘html_entity_decode’),

Thanks