Welcome Guest, Not a member yet? Register   Sign In
Private validation methods
#2

[eluser]TheFuzzy0ne[/eluser]
Ah nuts. That one line of code breaks the function. How embarrassing...

This should do it (hopefully without embarrassing myself further).

Code:
//Line 243

            /*

             * Set the current field

             *

             * The various prepping functions need to know the

             * current field name so they can do this:

             *

             * $_POST[$this->_current_field] == 'bla bla';

             */

            $this->_current_field = $field;



            // Cycle through the rules!

            foreach ($ex As $rule)

            {

                // Is the rule a callback?

                $callback = FALSE;

                if (substr($rule, 0, 9) == 'callback_')

                {

                    $rule = substr($rule, 9);

# Start edit

                    /**

                     * Check to see if the callback function exists. If

                     * it doesn't, assume we need to add prefix the function

                     * name with an underscore

                     */

                    if (!method_exists($this->CI, $rule) AND !method_exists($this, $rule) AND !function_exists($rule))

                            $rule = "_$rule";

# End edit

                    $callback = TRUE;

                }

//Line 273

Feedback welcome.


Messages In This Thread
Private validation methods - by El Forum - 09-18-2008, 02:46 PM
Private validation methods - by El Forum - 09-18-2008, 03:57 PM
Private validation methods - by El Forum - 09-18-2008, 04:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB