You could use array_walk to do this if you know the model name it'd be easier http://php.net/manual/en/function.array-walk.php
array_walk($this->request->data['Model'], '_purify')
On 11 August 2014 12:24, vbpupil <vbpupil@gmail.com> wrote:
Not sure if anyone is familiar with this plugin? i have it installed and can sanaitize indiviual strings ie:--
$test = Purifier::clean('<strong>hi<script>$( document ).ready(function() { alert("hacked!");});</script>', 'general');
which is working fine but i want to sanitize my form data ie:
$this->request->data = Purifier::clean($this->request->data, 'general');
which is failing because its an array (see below). Surely there must be an easier way to do this?
preg_match() expects parameter 2 to be string, array given [APP/Plugin/HtmlPurifier/Vendor/HtmlPurifier/library/HTMLPurifier/Lexer.php, line 316]
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Kind Regards
Stephen Speakman
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment