why would you want to do that in the first place
despite the fact that every line of code in your snippet seems to be
wrong^^

what you need is h() - in the view templates:
<?php echo h($var); ?>

thats all you need to escape and secure your views.


On 14 Dez., 07:08, "Dave Maharaj" <[email protected]> wrote:
> Off the top of my head I do not think stripTags works over each element of
> an array like $this->data
>
> You would need to be specific to the key like
> $this->data['GoogleNews']['content'] or whatever field. Check out
> Sanitize::clean , that works thru the array of $this->data with  8 different
> options to apply to the data set.
>
> Dave
>
>
>
>
>
>
>
> -----Original Message-----
> From: Lord_JABA [mailto:[email protected]]
> Sent: December-13-10 5:48 PM
> To: CakePHP
> Subject: Why Sanitize::stripTags not working in controller index() function;
>
> I want to get rid of div tags in data from rss just before i send it
> to view.
> I'm trying do this that way:
> function index(){
>                 $this->data=Sanitize::stripTags($this->data, 'div');
>                 $this->set('gnews',  $this->paginate('GoogleNews') );
>         }
> and that way:
> function index(){
>                 Sanitize::stripTags($this->data, 'div');
>                 $this->set('gnews',  $this->paginate('GoogleNews') );
>         }
> but I'm still getting:
> (...)HTC EVO 4G</a></div><div></div><div>(...)
> from<?php debug($gnews)?>
>
> What mistake I'm making??
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to