diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-06-15 00:02:16 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-06-15 00:02:16 +0200 |
commit | c9bb0c5b7a3a349a5c255b02b5cc7ddbe32132e5 (patch) | |
tree | 905ff3f3153720c1d1547092e54feaf0e46568a6 /system/libraries/Form_validation.php | |
parent | 3061ee737ff2c1853428482e1704b0973b621118 (diff) | |
parent | f11a1939c25de1e327c7c02001c8fbd1ec1fc7b4 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r-- | system/libraries/Form_validation.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 225325d6f..6cbe032c7 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -187,6 +187,12 @@ class CI_Form_validation { return $this; } + // Convert an array of rules to a string + if (is_array($rules)) + { + $rules = implode('|', $rules); + } + // No fields? Nothing to do... if ( ! is_string($field) OR ! is_string($rules) OR $field === '') { @@ -1089,11 +1095,12 @@ class CI_Form_validation { * Validate IP Address * * @param string + * @param string 'ipv4' or 'ipv6' to validate a specific IP format * @return bool */ - public function valid_ip($ip) + public function valid_ip($ip, $which = '') { - return $this->CI->input->valid_ip($ip); + return $this->CI->input->valid_ip($ip, $which); } // -------------------------------------------------------------------- |