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

[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.

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


doesn't
Code:
$rules['password'] = "required | matches[password_confirm]";
#2

[eluser]xwero[/eluser]
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.
#3

[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