CodeIgniter Forums

Full Version: Form Validation CI v3.1.10
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Everyone,

I am tinkering on a long term project, and have updated from CI v3.1.9 to v3.1.10.

With v3.1.9, the Form Validation with a callback set in an array returned any processed data set against that $_POSTed value.  That is, the following rule when processed, returned $data set by the function _user_sign_in_check(), when I had a conditional statement equating to be TRUE.  The returned $data was assigned to the $_POSTed 'email_address' variable.


PHP Code:
$this->form_validation->set_rules(
 
 'email_address',
 
 'Email Address',
 
 array(
 
   'trim',
 
   'required',
 
   'valid_email',
 
   array(
 
     'email_address',
 
     array$this->users_mdl'_user_sign_in_check' )
 
   )
 
 ),
 
 array(
 
   'required' => 'You have not provided an <b>%s</b>.',
 
   'valid_email' => 'The <b>%s</b> you have entered is not valid!'
 
 )
); 

With v3.1.10, the Form Validation now just requires to return TRUE for the same conditional check in the function _user_sign_in_check().  When processing the validation which has returned TRUE, (passed), the $_POSTed 'email_address' now holds the actual $_POSTed email address from the form.  If I try to return any processed $data, I have a NULL array.

Has the behavior changed from v3.1.9 to v3.1.10?  I did not mind the callback function returning usable data to the form validation.

I can use the $_POSTed 'email_address' on either side - callback function, or form validation being TRUE - to obtain the User's data, but just curious if this was a change with the v3.1.10 release, as the release notes to not state it explicitly.


Ian.