We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 2de0223d authored by jurgbohn's avatar jurgbohn

Case insensitive check on username before registration, min-limit of 3 chars

parent ecaa8803
......@@ -44,7 +44,7 @@ if(isset($_POST['register'])) {
//Basic validation
if(!preg_match("/^[a-zA-Z0-9_]{1,}$/", $username)) {
if(!preg_match("/^[a-zA-Z0-9_]{3,}$/", $username)) {
$errors .= "Your username must be atleast 1 character in length and only consist of <i>a-z, A-Z, 0-9</i> and _ (underscore).<br />";
}
if(empty($password)) {
......@@ -58,7 +58,7 @@ if(isset($_POST['register'])) {
}
//Check this username is available
$res = $mdb2->query("SELECT username FROM Users WHERE username = " . $mdb2->quote($username));
$res = $mdb2->query("SELECT username FROM Users WHERE username ~* " . $mdb2->quote($username));
if($res->numRows()) {
$errors .= "Sorry, that username is already registered.<br />";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment