Most tutorials or tips online refer to before Save () as a good before
saving to clean data and what not but never have i seen anything on
beforeValidate as beforeValidate seems to be better to use i would think.
No?
 
For example city has validation rules say min 5 characters if someone enters
"<p>b</p>"  into the city field that meets the minimum 5 character yes then
you beforeSave clean out the html so you left with "b" as the city name yet
thats not 5 charaters you were wanting to ensure. so you save "b" as the
city name
 
Is it not best to say use beforeValidate to clean up your data make sure it
meets validation if so then do your beforesave on that data?
 
I was using beforeSave and noticed i could trick cake into thinking it was
ok and could actually just put html tags into fields to meet min
requirements, a-z-0-9 and actually save an entire form record and every
field inthe db was completely blank because it said it was valid and the
data that was safe to save was actually nothing yet i set up notempty =>
true.
 
Any thoughts?
 
Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to