I just realized this is not working properly in PHP4, must have
something to do with passing the array by reference... the method
worked fine on my laptop, where I have php5.2.1 installed, then I
moved things to my desktop, the validation stopped working, and i went
a little insane - I just upgrad
"...the error I get shows that a query ('__sanitize') is being
made to the db. "
I'm not sure, but it sounds like you're accidentally placing
'__sanitize' as a string inside your $data array, instead of the
*results* of that function. This would then get passes through to the
SQL call causing the
Hi,
Thanks for trying the code out - there are no SQL queries within the
__sanitize function and the error as described sounds *really* counter-
intuitive. What version of cake are you using out of interest?
In terms of your controller block, nothing obviously wrong there, you
may wish to consid
@ianh
I followed your instructions, but I am now getting an SQL error during
validation! I don't understand how, why or where the query takes
place, but the error I get shows that a query ('__sanitize') is being
made to the db. I am using Zend's IDE that I purched a few years ago,
but it isn't po
Thank you very much for the response. I will work on integrating your
code. I'm new to Cake, so this provides me with a bit more insight as
to how I need to accomplish certain tasks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Hi,
I agree that data cleaning and sanitization is best kept out of the
controller and in the model. However, before I present my solution and
for the sake of completeness, there are two functions,
sanitize::paranoid and sanitize::cleanArray that work from the
controller. I and others have found
I thought that data cleaning should be done prior to a save, so I
tried using stripAll in the model as follows:
function beforeSave()
{
require_once('sanitize.php');
$cleaner = new Sanitize();
$profile = $this->data;
$fields['Profile'] = $this->getColumnTy