summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2013-02-04 19:48:43 +0100
committerAndrey Andreev <narf@bofh.bg>2013-02-04 19:48:43 +0100
commit1d6d278607f021e5c430192e14de641904575d5d (patch)
tree96cf7c5e59d45794724c9eb741ba816ca114fc78 /system/libraries/Form_validation.php
parent2ccb60ed153a7c86c31a230c08bd42f22111398a (diff)
parentf9866509fbe79186976a9e4b0ca1aaa7fe0bdc7b (diff)
Merge pull request #2220 from sajanNOPPIX/develop
New Form Validation Rule: alpha_numeric_spaces
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index bbd0b523e..1511d9add 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -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