summaryrefslogtreecommitdiffstats
path: root/system/libraries/Validation.php
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-08-27 03:52:51 +0200
committeradmin <devnull@localhost>2006-08-27 03:52:51 +0200
commit141808ad31d4eefad4c6c3dbaf8306fac2342668 (patch)
tree25c40e5e4e18fb27bb2826ac6ce8fbffd844281c /system/libraries/Validation.php
parentb071bb5a92aade551345a495fb13f5678f3978d0 (diff)
Diffstat (limited to 'system/libraries/Validation.php')
-rw-r--r--system/libraries/Validation.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php
index df8c70ee8..e037e69c5 100644
--- a/system/libraries/Validation.php
+++ b/system/libraries/Validation.php
@@ -252,12 +252,12 @@ class CI_Validation {
// Strip the parameter (if exists) from the rule
// Rules can contain a parameter: max_length[5]
$param = FALSE;
- if (preg_match("/.*?(\[.*?\]).*/", $rule, $match))
+ if (preg_match("/(.*?)\[(.*?)\]/", $rule, $match))
{
- $param = substr(substr($match['1'], 1), 0, -1);
- $rule = str_replace($match['1'], '', $rule);
+ $rule = $match[1];
+ $param = $match[2];
}
-
+
// Call the function that corresponds to the rule
if ($callback === TRUE)
{