summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorTim Nolte <noltet@sekisui-spi.com>2015-06-18 20:48:40 +0200
committerTim Nolte <noltet@sekisui-spi.com>2015-06-18 20:48:40 +0200
commit8c69150e31052f50c16750e2dcfdc312148f109d (patch)
tree51316d944c134603b3a026a2deaf97a69471572c /system/libraries
parent89ed9fafd75e3b65a7691f1b13440bdedadf5eda (diff)
parentbd1e61500383245aec702f645955a774604687c6 (diff)
Merge branch 'develop' into feature/mysqli-ssl
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Form_validation.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 7599602c0..d9ecc45f9 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -618,6 +618,12 @@ class CI_Form_validation {
$rules = array(1 => $rule);
break;
}
+ elseif (is_array($rule) && isset($rule[0], $rule[1]) && is_callable($rule[1]))
+ {
+ $callback = TRUE;
+ $rules = array(array($rule[0], $rule[1]));
+ break;
+ }
}
if ( ! $callback)
@@ -815,11 +821,10 @@ class CI_Form_validation {
// Callable rules might not have named error messages
if ( ! is_string($rule))
{
- return;
+ $line = $this->CI->lang->line('form_validation_error_message_not_set').'(Anonymous function)';
}
-
// Check if a custom message is defined
- if (isset($this->_field_data[$row['field']]['errors'][$rule]))
+ elseif (isset($this->_field_data[$row['field']]['errors'][$rule]))
{
$line = $this->_field_data[$row['field']]['errors'][$rule];
}