From 141808ad31d4eefad4c6c3dbaf8306fac2342668 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 27 Aug 2006 01:52:51 +0000 Subject: --- system/libraries/Validation.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/libraries/Validation.php') 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) { -- cgit v1.2.3-24-g4f1b