Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php
index 33753bc..575c526 100644
--- a/system/libraries/Validation.php
+++ b/system/libraries/Validation.php
@@ -195,7 +195,7 @@
$ex = explode('|', $rules);
// Is the field required? If not, if the field is blank we'll move on to the next test
- if ( ! in_array('required', $ex, TRUE) AND strpos($rules, 'callback_') === FALSE)
+ if ( ! in_array('required', $ex, TRUE))
{
if ( ! isset($_POST[$field]) OR $_POST[$field] == '')
{
@@ -546,7 +546,7 @@
*/
function numeric($str)
{
- return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE;
+ return ! preg_match('/[^0-9]/', $str);
}
// --------------------------------------------------------------------