umutau
(Umutau)
May 27, 2009, 5:46am
1
Hi I want to use ChtmlPurifier but it gives me error like "CHtmlPurifier does not have a method named "options"
CHtmlPurifier does not have a method named "options". My codes are below. Is there any example to use CHtmlPurifier or any help to fix my codes apporiciated
Thanks
qwerty
(qwerty)
May 27, 2009, 7:41am
2
Hi,
CHtmlPurifier is a widget. Here you have example: http://www.yiiframew…4.html#msg12444
umutau
(Umutau)
May 27, 2009, 1:07pm
3
I think I can use CHtmlPurifier as a object class as well and create object and call options and purify functions can't I?
http://www.yiiframew…56.html#msg1649
qwerty
(qwerty)
May 27, 2009, 10:24pm
4
Hi,
options is property. You should write:
$p->options = array('URI.AllowedSchemes'=>array('http' => true,
'https' => true,
'mailto' => true,
'ftp' => true,
'nntp' => true,
'news' => true,
)
);
umutau
(Umutau)
May 28, 2009, 4:24am
5
Even if I change that it gives me error saying that
preg_match() expects parameter 2 to be string, array given
very simple if I want to deny customer to enter script tag into textfield and my codes are below
It gives me same error. Any idea?
Thanks
qwerty
(qwerty)
May 28, 2009, 6:07am
6
Hi,
purify method get string parameter. So, if you want to parse textfield`s content you can try:
$site->content=$p->purify($_POST['Site']['content']);
where 'content' is your attribute of model.
If you will parse all attributes you have to use foreach loop.