diff options
author | Andrey Andreev <narf@devilix.net> | 2014-03-10 18:55:11 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-03-10 18:55:11 +0100 |
commit | fde170c0640a04e0d9d686bfa368e1f368cc1ba1 (patch) | |
tree | bad6d91cac522c96d2bb654c0e3477ff87eafb6c /system | |
parent | 8155baba6e9a24235d7324427d926e2200fe566d (diff) |
Fix #2928, #2929
Diffstat (limited to 'system')
-rw-r--r-- | system/database/DB_forge.php | 1 | ||||
-rw-r--r-- | system/libraries/Form_validation.php | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index bcf7a8d71..38e4ccf2c 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -809,6 +809,7 @@ abstract class CI_DB_forge { $field['length'] = is_array($attributes['CONSTRAINT']) ? "('".implode("','", $attributes['CONSTRAINT'])."')" : '('.$attributes['CONSTRAINT'].')'; + break; default: $field['length'] = is_array($attributes['CONSTRAINT']) ? '('.implode(',', $attributes['CONSTRAINT']).')' diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 0a80888d2..31d73303e 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -208,11 +208,12 @@ class CI_Form_validation { // If the field label wasn't passed we use the field name $label = ($label === '') ? $field : $label; + $indexes = array(); + // Is the field name an array? If it is an array, we break it apart // into its components so that we can fetch the corresponding POST data later if (($is_array = (bool) preg_match_all('/\[(.*?)\]/', $field, $matches)) === TRUE) { - $indexes = array(); sscanf($field, '%[^[][', $indexes[0]); for ($i = 0, $c = count($matches[0]); $i < $c; $i++) |