summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Form_validation.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index b0ba8bbcb..7056558c5 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -670,7 +670,11 @@ class CI_Form_validation {
// Strip the parameter (if exists) from the rule
// Rules can contain a parameter: max_length[5]
$param = FALSE;
- sscanf($rule, '%[^[][%[^]]', $rule, $param);
+ if (preg_match('/(.*?)\[(.*)\]/', $rule, $match))
+ {
+ $rule = $match[1];
+ $param = $match[2];
+ }
// Call the function that corresponds to the rule
if ($callback === TRUE)