Hi Graham - thanks for giving the function a whirl. If you can still
see the data after sanitization then the most obvious thing to ask is
are you calling it correctly? It must look like this:

function beforeValidate()
{
  $this->__sanitize($this->data);
  return true;
}

It is vital that the beforeValidate includes a return true statement
otherwise the save thinks validation has failed. If return true is
there are the thing still failes then you could break up your save
into components to find which bit fails like this (for 1.1.x only):

if($this->{$this->modelClass}->validates($this->data)) {
  if($this->{$this->modelClass}->save($this->data)) {
    echo "everything A Ok!";
  } else {
    echo "save failed";
  }
} else {
  echo "validation failed";
}

Let me know what happens or paste up your code somewhere
(pastebin.co.uk) and I will take a look for you.

Cheers, Ian

On Apr 29, 10:45 pm, gmwebs <[EMAIL PROTECTED]> wrote:
> Hi Ian,
>
> I had a go using your __sanitize() function and while the actual
> sanitization is working, I don't seem to be able to save my model. If
> I view the input before calling __sanitize() in beforeValidate() and
> then after, it proves that the inputs are sanitized just as expected.
> Unfortunately the Model->save() fails after the __sanitize call and I
> can't seem to find where/how it is failing. If I remove the
> __sanitize() call then it saves perfectly (with clean inputs of
> course). I know it's a long shot, but do you have any ideas why this
> could be?
>
> Regards,
>
> Graham


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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