Re: Data cleanup in Model

2007-04-11 Thread [EMAIL PROTECTED]
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

Re: Data cleanup in Model

2007-03-27 Thread NOSLOW
"...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

Re: Data cleanup in Model

2007-03-26 Thread ianh
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

Re: Data cleanup in Model

2007-03-26 Thread Michael Tuzi
@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

Re: Data cleanup in Model

2007-03-26 Thread Michael Tuzi
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

Re: Data cleanup in Model

2007-03-25 Thread ianh
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

Data cleanup in Model

2007-03-24 Thread Michael Tuzi
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