summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/Form_validation.php15
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 7 insertions, 9 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index e8bd25b58..852fc7144 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -414,18 +414,15 @@ class CI_Form_validation {
return FALSE;
}
- // Is there a validation rule for the particular URI being accessed?
- $uri = ($group === '') ? trim($this->CI->uri->ruri_string(), '/') : $group;
-
- if ($uri !== '' && isset($this->_config_rules[$uri]))
+ if (empty($group))
{
- $this->set_rules($this->_config_rules[$uri]);
- }
- else
- {
- $this->set_rules($this->_config_rules);
+ // Is there a validation rule for the particular URI being accessed?
+ $group = trim($this->CI->uri->ruri_string(), '/');
+ isset($this->_config_rules[$group]) OR $group = $this->CI->router->class.'/'.$this->CI->router->method;
}
+ $this->set_rules(isset($this->_config_rules[$group]) ? $this->_config_rules[$group] : $this->_config_rules);
+
// Were we able to set the rules correctly?
if (count($this->_field_data) === 0)
{
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 32d033c9b..2ad8eff0f 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -638,6 +638,7 @@ Bug fixes for 3.0
- Fixed a bug (#2579) - :doc:`Query Builder <database/query_builder>`s "no escape" functionality didn't work properly with query cache.
- Fixed a bug (#2237) - :doc:`Parser Library <libraries/parser>` failed if the same tag pair is used more than once within a template.
- Fixed a bug (#2268) - :doc:`Security Library <libraries/security>` didn't properly match JavaScript events.
+- Fixed a bug (#2143) - :doc:`Form Validation Library <libraries/form_validation>` didn't check for rule groups named in a *controller/method* manner when trying to load from a config file.
Version 2.1.4
=============