Welcome Guest, Not a member yet? Register   Sign In
isset/required validation bug
#4

[eluser]mjijackson[/eluser]
The full function is too large to post in this forum. Instead, I'll post the relevant portion. This is starting on line 206 of system/libraries/Validation.php:

Code:
/*
* Are we dealing with an "isset" rule?
*
* Before going further, we'll see if one of the rules
* is to check whether the item is set (typically this
* applies only to checkboxes).  If so, we'll
* test for it here since there's not reason to go
* further
*/
if ( ! isset($_POST[$field]))
{            
    if (in_array('isset', $ex, TRUE) OR in_array('required', $ex))
    {
        if ( ! isset($this->_error_messages['isset']))
        {
            if (FALSE === ($line = $this->CI->lang->line('isset')))
            {
                $line = 'The field was not set';
            }
        }
        else
        {
            $line = $this->_error_messages['isset'];
        }
        
        // Build the error message
        $field = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field];
        $message = sprintf($line, $field);
        
        // Set the error variable.  Example: $this->username_error
        $error = $field.'_error';
        $this->$error = $this->_error_prefix.$message.$this->_error_suffix;
        
        // Add the error to the error array
        $this->_error_array[] = $message;
    }
    
    continue;
}

The above post is also correct.


Messages In This Thread
isset/required validation bug - by El Forum - 08-21-2007, 05:06 PM
isset/required validation bug - by El Forum - 08-21-2007, 05:51 PM
isset/required validation bug - by El Forum - 08-22-2007, 08:19 AM
isset/required validation bug - by El Forum - 08-22-2007, 08:51 AM
isset/required validation bug - by El Forum - 08-22-2007, 10:04 AM
isset/required validation bug - by El Forum - 08-22-2007, 11:56 AM
isset/required validation bug - by El Forum - 08-29-2007, 03:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB