From 38b5eb0cccd06c1819c5c69fc967ce802b39835a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 10 Jun 2015 17:38:26 +0300 Subject: Fix #3903 --- system/libraries/Form_validation.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'system') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 7599602c0..36a8148df 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -815,11 +815,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]; } -- cgit v1.2.3-24-g4f1b From 29de16588458b1abc1b2fb4d125bd9fe04e755c6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 11 Jun 2015 17:44:20 +0300 Subject: Fix #3904 --- system/libraries/Form_validation.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'system') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 36a8148df..0251286ea 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($rule[0] => $rule[1]); + break; + } } if ( ! $callback) -- cgit v1.2.3-24-g4f1b From 9409a2a02c1097d14ce30b3587011a7cd00d046c Mon Sep 17 00:00:00 2001 From: Michael Foss Date: Fri, 12 Jun 2015 20:22:39 -0400 Subject: Fix typo in url_title function description. --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') 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) -- cgit v1.2.3-24-g4f1b From bd1e61500383245aec702f645955a774604687c6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 15 Jun 2015 18:28:36 +0300 Subject: Fix #3908 --- system/libraries/Form_validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 0251286ea..d9ecc45f9 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -621,7 +621,7 @@ class CI_Form_validation { elseif (is_array($rule) && isset($rule[0], $rule[1]) && is_callable($rule[1])) { $callback = TRUE; - $rules = array($rule[0] => $rule[1]); + $rules = array(array($rule[0], $rule[1])); break; } } -- cgit v1.2.3-24-g4f1b