Skip to content

Commit df3bfed

Browse files
author
Sajan Parikh
committed
Cleaned up for pull request.
Signed-off-by: Sajan Parikh <sajan@noppix.com>
1 parent 9c0b890 commit df3bfed

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎system/language/english/form_validation_lang.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@
2828

2929
$lang['form_validation_required'] = 'The {field} field is required.';
3030
$lang['form_validation_isset'] = 'The {field} field must have a value.';
31-
$lang['form_validation_valid_email'] = 'The {field} field must contain a valid email address.';
32-
$lang['form_validation_valid_emails'] = 'The {field} field must contain all valid email addresses.';
31+
$lang['form_validation_valid_email'] = 'The {field} field must contain a valid email address.';
32+
$lang['form_validation_valid_emails'] = 'The {field} field must contain all valid email addresses.';
3333
$lang['form_validation_valid_url'] = 'The {field} field must contain a valid URL.';
3434
$lang['form_validation_valid_ip'] = 'The {field} field must contain a valid IP.';
3535
$lang['form_validation_min_length'] = 'The {field} field must be at least {param} characters in length.';
3636
$lang['form_validation_max_length'] = 'The {field} field cannot exceed {param} characters in length.';
37-
$lang['form_validation_exact_length'] = 'The {field} field must be exactly {param} characters in length.';
37+
$lang['form_validation_exact_length'] = 'The {field} field must be exactly {param} characters in length.';
3838
$lang['form_validation_alpha'] = 'The {field} field may only contain alphabetical characters.';
39-
$lang['form_validation_alpha_numeric'] = 'The {field} field may only contain alpha-numeric characters.';
39+
$lang['form_validation_alpha_numeric'] = 'The {field} field may only contain alpha-numeric characters.';
4040
$lang['form_validation_alpha_numeric_spaces'] = 'The {field} field may only contain alpha-numeric characters and spaces.';
4141
$lang['form_validation_alpha_dash'] = 'The {field} field may only contain alpha-numeric characters, underscores, and dashes.';
4242
$lang['form_validation_numeric'] = 'The {field} field must contain only numbers.';
4343
$lang['form_validation_is_numeric'] = 'The {field} field must contain only numeric characters.';
4444
$lang['form_validation_integer'] = 'The {field} field must contain an integer.';
45-
$lang['form_validation_regex_match'] = 'The {field} field is not in the correct format.';
45+
$lang['form_validation_regex_match'] = 'The {field} field is not in the correct format.';
4646
$lang['form_validation_matches'] = 'The {field} field does not match the {param} field.';
4747
$lang['form_validation_differs'] = 'The {field} field must differ from the {param} field.';
4848
$lang['form_validation_is_unique'] = 'The {field} field must contain a unique value.';

‎system/libraries/Form_validation.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,8 +1229,6 @@ public function alpha_numeric($str)
12291229
return ctype_alnum((string) $str);
12301230
}
12311231

1232-
// --------------------------------------------------------------------
1233-
12341232
// --------------------------------------------------------------------
12351233

12361234
/**
@@ -1241,7 +1239,7 @@ public function alpha_numeric($str)
12411239
*/
12421240
public function alpha_numeric_spaces($str)
12431241
{
1244-
return (bool) preg_match('#^[A-Z0-9 ]+$#i', $str);
1242+
return (bool) preg_match('/^[A-Z0-9 ]+$/i', $str);
12451243
}
12461244

12471245
// --------------------------------------------------------------------

‎user_guide_src/source/libraries/form_validation.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,8 @@ Rule Parameter Description
879879
**alpha** No Returns FALSE if the form element contains anything other than alphabetical characters.
880880
**alpha_numeric** No Returns FALSE if the form element contains anything other than alpha-numeric characters.
881881
**alpha_numeric_spaces** No Returns FALSE if the form element contains anything other than alpha-numeric characters
882-
or spaces. Should be used after trim to avoid spaces at the beginning or end.
883-
**alpha_dash** No Returns FALSE if the form element contains anything other than alpha-numeric characters,
882+
or spaces. Should be used after trim to avoid spaces at the beginning or end.
883+
**alpha_dash** No Returns FALSE if the form element contains anything other than alpha-numeric characters,
884884
underscores or dashes.
885885
**numeric** No Returns FALSE if the form element contains anything other than numeric characters.
886886
**integer** No Returns FALSE if the form element contains anything other than an integer.

0 commit comments

Comments
 (0)