eveloper wrote: > Thanks for your reply Grant. I noticed that cleanArray does not do > trimming for white spaces at the beginning and at the end of the string.
The Sanitize does not trim the params, just clean them in order to prevent, for example, sql exploit. Follows a strip of code I use to trim the whole form data. function beforeValidate(){ ... //trimming whole data $data = $this->data["YourModelHere"]; foreach($data as $index=>$elem){ if(is_string($elem)) $data[$index] = trim($elem); } $this->data["YourModelHere"] = $data; ... return true; } HTH, bye Davide
signature.asc
Description: OpenPGP digital signature