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

Commit e0ce92c9 authored by clint's avatar clint

Disallow underscores in initial and final positions of usernames.

parent f142e8ce
......@@ -80,8 +80,8 @@ if(isset($_POST['register'])) {
//Basic validation
if(!preg_match('/^[a-zA-Z0-9_]{3,16}$/', $username)) {
$errors .= 'Your username must be atleast 3 characters in length (max 16) and only consist of <i>a-z, A-Z, 0-9</i> and _ (underscore).<br />';
if(!preg_match('/^[a-zA-Z0-9][a-zA-Z0-9_]{1,14}[a-zA-Z0-9]$/', $username)) {
$errors .= 'Your username must be at least 3 characters in length (max 16) and only consist of <i>a-z, A-Z, 0-9</i> and _ (underscore), and may not begin or end with an underscore.<br />';
}
if(empty($password)) {
$errors .= 'You must enter a password.<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