summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/helpers/url_helper.php2
-rw-r--r--system/libraries/Form_validation.php11
2 files changed, 9 insertions, 4 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index 5f8c6ce67..6a033d6ba 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -474,7 +474,7 @@ if ( ! function_exists('url_title'))
* @param string $str Input string
* @param string $separator Word separator
* (usually '-' or '_')
- * @param bool $lowercase Wether to transform the output string to lowercase
+ * @param bool $lowercase Whether to transform the output string to lowercase
* @return string
*/
function url_title($str, $separator = '-', $lowercase = FALSE)
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];
}