thanks Stephen

ill keep playing but wasnt able to get it working using this method, ill 
keep reading the link you provided.

Im wondering if this is the right way to go or save all user data and strip 
when i come to use the data. I know this is a little off topic but would be 
interested in hearing your thoughts?

On Monday, August 11, 2014 12:31:29 PM UTC+1, Stephen S wrote:
>
> 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 <vbp...@gmail.com <javascript:>> 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+u...@googlegroups.com <javascript:>.
>> To post to this group, send email to cake...@googlegroups.com 
>> <javascript:>.
>> 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+unsubscr...@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.

Reply via email to