Form_validation callbacks with parameters bug (?) |
[eluser]sckarlin[/eluser]
Lifted from this thread: http://ellislab.com/forums/viewthread/180085/ Apologies if this kind of cross-posting is inappropriate. I'm not sure where to report a bug -- if this is, indeed, one. For several years, I have used the feature to give a custom callback a parameter in form validation. The new Form_validation code seems to have broken this. For example, I have call back functions that expect the contents between the square brackets to appear as the second parameter of a callback. A rule might look like this: Code: 'callback__if_and[foo==bar]' The problem is in approximately line 492 of Form_validation for CI 2.0.0: Code: if ( ! in_array('required', $rules) AND is_null($postdata)) The fix may be to either fix the preg_match regex, or to simply remove the $rules re-assignment after setting $callback to TRUE.
[eluser]sckarlin[/eluser]
Looks like someone else has noticed this, too: https://bitbucket.org/ellislab/codeignit...r-does-not |
Welcome Guest, Not a member yet? Register Sign In |