clsu wrote:
> var $validate =rray(
> 'login' ='/[a-z0-9\_\-]{3,}$/i',
> );
> ...
> then, open browser and input \aaa in the login input field
> the problem is coming, i did't set \ character in my validates array,
> why cakephp let it pass ?IIRC, cake validation, simply call a preg_match against your pattern; so I will point to the regex you specified. By the regex you specified I understand that you want an entire string only of letters, numbers, _ and - of at least 3 characters. But the regex you have specified, is vaild even if you specify @@aaa 'cause the "aaa" will validate the expression. If you want the entire string, try with the pattern "/^[a-z0-9\_\-$/i". Hope I didn't say something stupid :) HTH Davide -- By the power of Greyskull...
signature.asc
Description: OpenPGP digital signature
