summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php21
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