summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/language/english/form_validation_lang.php10
-rw-r--r--system/libraries/Form_validation.php4
-rw-r--r--user_guide_src/source/libraries/form_validation.rst4
3 files changed, 8 insertions, 10 deletions
diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php
index 476123b06..7c0277c25 100644
--- a/system/language/english/form_validation_lang.php
+++ b/system/language/english/form_validation_lang.php
@@ -28,21 +28,21 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$lang['form_validation_required'] = 'The {field} field is required.';
$lang['form_validation_isset'] = 'The {field} field must have a value.';
-$lang['form_validation_valid_email'] = 'The {field} field must contain a valid email address.';
-$lang['form_validation_valid_emails'] = 'The {field} field must contain all valid email addresses.';
+$lang['form_validation_valid_email'] = 'The {field} field must contain a valid email address.';
+$lang['form_validation_valid_emails'] = 'The {field} field must contain all valid email addresses.';
$lang['form_validation_valid_url'] = 'The {field} field must contain a valid URL.';
$lang['form_validation_valid_ip'] = 'The {field} field must contain a valid IP.';
$lang['form_validation_min_length'] = 'The {field} field must be at least {param} characters in length.';
$lang['form_validation_max_length'] = 'The {field} field cannot exceed {param} characters in length.';
-$lang['form_validation_exact_length'] = 'The {field} field must be exactly {param} characters in length.';
+$lang['form_validation_exact_length'] = 'The {field} field must be exactly {param} characters in length.';
$lang['form_validation_alpha'] = 'The {field} field may only contain alphabetical characters.';
-$lang['form_validation_alpha_numeric'] = 'The {field} field may only contain alpha-numeric characters.';
+$lang['form_validation_alpha_numeric'] = 'The {field} field may only contain alpha-numeric characters.';
$lang['form_validation_alpha_numeric_spaces'] = 'The {field} field may only contain alpha-numeric characters and spaces.';
$lang['form_validation_alpha_dash'] = 'The {field} field may only contain alpha-numeric characters, underscores, and dashes.';
$lang['form_validation_numeric'] = 'The {field} field must contain only numbers.';
$lang['form_validation_is_numeric'] = 'The {field} field must contain only numeric characters.';
$lang['form_validation_integer'] = 'The {field} field must contain an integer.';
-$lang['form_validation_regex_match'] = 'The {field} field is not in the correct format.';
+$lang['form_validation_regex_match'] = 'The {field} field is not in the correct format.';
$lang['form_validation_matches'] = 'The {field} field does not match the {param} field.';
$lang['form_validation_differs'] = 'The {field} field must differ from the {param} field.';
$lang['form_validation_is_unique'] = 'The {field} field must contain a unique value.';
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 7b9215c04..1511d9add 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -1230,8 +1230,6 @@ class CI_Form_validation {
}
// --------------------------------------------------------------------
-
- // --------------------------------------------------------------------
/**
* Alpha-numeric w/ spaces
@@ -1241,7 +1239,7 @@ class CI_Form_validation {
*/
public function alpha_numeric_spaces($str)
{
- return (bool) preg_match('#^[A-Z0-9 ]+$#i', $str);
+ return (bool) preg_match('/^[A-Z0-9 ]+$/i', $str);
}
// --------------------------------------------------------------------
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst
index 51205afa4..8b35fdc75 100644
--- a/user_guide_src/source/libraries/form_validation.rst
+++ b/user_guide_src/source/libraries/form_validation.rst
@@ -879,8 +879,8 @@ Rule Parameter Description
**alpha** No Returns FALSE if the form element contains anything other than alphabetical characters.
**alpha_numeric** No Returns FALSE if the form element contains anything other than alpha-numeric characters.
**alpha_numeric_spaces** No Returns FALSE if the form element contains anything other than alpha-numeric characters
- or spaces. Should be used after trim to avoid spaces at the beginning or end.
-**alpha_dash** No Returns FALSE if the form element contains anything other than alpha-numeric characters,
+ or spaces. Should be used after trim to avoid spaces at the beginning or end.
+**alpha_dash** No Returns FALSE if the form element contains anything other than alpha-numeric characters,
underscores or dashes.
**numeric** No Returns FALSE if the form element contains anything other than numeric characters.
**integer** No Returns FALSE if the form element contains anything other than an integer.