diff --git a/inside/migration/js/custom_validators.js b/inside/migration/js/custom_validators.js index 290dfd9..2542aa1 100644 --- a/inside/migration/js/custom_validators.js +++ b/inside/migration/js/custom_validators.js @@ -1,3 +1,3 @@ jQuery.validator.addMethod("lettersonly", function(value, element) { - return this.optional(element) || /^[a-z]+$/i.test(value); + return this.optional(element) || /^[a-z]+$/.test(value); }, "Please enter only letters (english alphabet)."); diff --git a/inside/migration/submit_user.php b/inside/migration/submit_user.php index a934cb9..ce30bc6 100644 --- a/inside/migration/submit_user.php +++ b/inside/migration/submit_user.php @@ -12,8 +12,8 @@ $errors = Array(); if( strlen($_POST['username']) < 3 && strlen($_POST['username']) > 15 ) { $result['errors']['username'][] = "Please enter a value between 3 and 15 characters long."; } -if( !preg_match("/[a-z]/i", $_POST['username']) ) { - $result['errors']['username'][] = "Please enter only letters (english alphabet)."; +if( !preg_match("/[a-z]/", $_POST['username']) ) { + $result['errors']['username'][] = "Please enter only lowercase letters (english alphabet)."; } if( file_get_contents("./user_exists.php") == "false" ) { $result['errors']['username'][] = "Username is taken.";