[eluser]Pnux[/eluser]
Take these rules as an example:
Code:
$config["user_name_last"] =
array(
array(
'field' => 'firstName',
'label' => 'First Name',
'rules' => 'callback_notAFunctionNamedLikeThis|max_length[2]'
)
);
with this code on the controller:
Code:
$this->load->library('form_validation');
$r = $this->form_validation->run('user_name_last');
var_dump($r);exit;
If firstName is set to "hello world", the validation will return FALSE because its longer than 2 characters. But if firstName is set to "n", the validation will return TRUE. Same thing applies using
Code:
'rules' => 'notARuleNamedLikeThis|max_length[2]'
The thing is the validation goes through without a problem and no error is displayed/logged. I consider this a bug as, along the way, a programmer can change the declaration of the rule/callback and forget to change it on the validation rules, leaving that rule obsolete and unnoticed until an issue arise. In my opinion, this should be prevented whenever possible; but what do you think?