diff options
author | Daniel Hunsaker <danhunsaker@gmail.com> | 2013-02-22 21:49:33 +0100 |
---|---|---|
committer | Daniel Hunsaker <danhunsaker@gmail.com> | 2013-02-22 21:49:33 +0100 |
commit | 44a6d1da2be916fe0f23a3ea4d5fcb391d7f65dd (patch) | |
tree | 31549ebf6ea5ea98e4347eb640d1caa685316f3e /system/libraries/Form_validation.php | |
parent | 353f9834adf3f44c6c7a0f924089bb2b43360404 (diff) | |
parent | eb291c1d1e1116a4420fa30e587adeea0451eeb7 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into feature/exit-status
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r-- | system/libraries/Form_validation.php | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index bbd0b523e..172e799f6 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -356,7 +356,7 @@ class CI_Form_validation { */ public function error_string($prefix = '', $suffix = '') { - // No errrors, validation passes! + // No errors, validation passes! if (count($this->_error_array) === 0) { return ''; @@ -517,7 +517,7 @@ class CI_Form_validation { { if (isset($_POST[$row['field']])) { - $_POST[$row['field']] = $this->prep_for_form($row['postdata']); + $_POST[$row['field']] = $row['postdata']; } } else @@ -543,14 +543,14 @@ class CI_Form_validation { $array = array(); foreach ($row['postdata'] as $k => $v) { - $array[$k] = $this->prep_for_form($v); + $array[$k] = $v; } $post_ref = $array; } else { - $post_ref = $this->prep_for_form($row['postdata']); + $post_ref = $row['postdata']; } } } @@ -1232,6 +1232,19 @@ class CI_Form_validation { // -------------------------------------------------------------------- /** + * Alpha-numeric w/ spaces + * + * @param string + * @return bool + */ + public function alpha_numeric_spaces($str) + { + return (bool) preg_match('/^[A-Z0-9 ]+$/i', $str); + } + + // -------------------------------------------------------------------- + + /** * Alpha-numeric with underscores and dashes * * @param string |