Form Validation callbacks not passing returned value to next rule |
[eluser]september28[/eluser]
Hi There, i am running CI reactor v 2.0.1 and have created some callback rules for my form validation. They are basically decoding a field that has been encrypted using Codeigniter's encrypt library. In this case I am Encrypting an email address (the string) and salting it with the API Key that the controller is being passed (the controller is accessed through an api call and X-API-KEY header is set to the correct API key). Here is my rule code: Code: $email_params = "{$this->input->post('email')},{$this->rest->key}"; The log_message calls are in for debugging purposes and all display the correct values in the log (this first shows the encrypted string and key, the second shows the decoded email and the third shows the decrypted email as returned by the callback function itself). My callback function is the following: Code: /* As you can see I also have a debug log message on the _decode_hash_rule method which also returns the decoded email address ([email protected] - the "Xs" are just there to blur the email) i also have put a debug log on the valid_email method in the Form_Validation library (system/libraries/Form_Validation.php). This returns the ENCRYPTED string still which prooves that the cascading rules are not functioning properly. Since the encrypted string is not a valid email, I receive the valid email error and so the form doesnt pass validation. In the Codeigniter userguide it states that the rules will be run right to left and either return booleen true or false, or return the processed value. if the processed value is returned, it will be used in all subsequent rules. In my example it doesn't seem to be happening. Does anyone know why this might be happening? Is this a bug in Codeigniter? Cheers, Dan |
Messages In This Thread |
Form Validation callbacks not passing returned value to next rule - by El Forum - 05-23-2011, 04:26 AM
Form Validation callbacks not passing returned value to next rule - by El Forum - 05-23-2011, 05:57 AM
Form Validation callbacks not passing returned value to next rule - by El Forum - 05-23-2011, 06:06 AM
Form Validation callbacks not passing returned value to next rule - by El Forum - 05-23-2011, 06:33 AM
Form Validation callbacks not passing returned value to next rule - by El Forum - 05-23-2011, 06:50 AM
|