Welcome Guest, Not a member yet? Register   Sign In
trim validation rules

[eluser]CI jforth[/eluser]
Just ran in to this don't know if it's a bug or not but if you have spaces between rules they get ignored.

$rules['password'] = "required|matches[password_confirm]";

$rules['password'] = "required | matches[password_confirm]";

I'm not sure if you can call this a bug. The rules string is documented without spaces which saves a trim function. I think it's a design choice the CI developers made to optimize the run method. The rules aren't checked in the set_rules method because of the callback functionality.

Maybe the divider could be configurable but i don't know if a lot of developers will change the default because the pipes character is a common divider.

[eluser]Michael Wales[/eluser]
I completely agree. Adding in trim() to each of the pipe-delimited strings is just added overhead. I see no reason why someone would be forced to not use the pipe-delimiters.

Theme © iAndrew 2016 - Forum software by © MyBB