Welcome Guest, Not a member yet? Register   Sign In
1.6 Validation class can't use is_numeric as a rule
#1

[eluser]dmorin[/eluser]
It appears that something has changed in the validation class. I used to use the native php function 'is_numeric' in the rules list and it worked fine. Now, it replaces the field with a 1 or blank depending on if it is numeric or not.

Of course, using 'numeric' works as specified in the user guide.
#2

[eluser]Derek Allard[/eluser]
Could you try something for me? Could you add this into system/libraries/validation.php?

Code:
// --------------------------------------------------------------------
    
    /**
     * Is Numeric
     *
     * @access    public
     * @param    string
     * @return    bool
     */    
    function is_numeric($str)
    {
        return ( ! is_numeric($str)) ? FALSE : TRUE;
    }

and let me know if it works? If it does (it should) I'll commit this for you immediately.
#3

[eluser]dmorin[/eluser]
Yes, that fixes it. Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB