From 4682d34674a6ca13b55dba0ed464441911c811d9 Mon Sep 17 00:00:00 2001 From: Krombel Date: Thu, 24 Jan 2019 01:59:36 +0100 Subject: [PATCH] fix 'allow username to contain digits' --- public/index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/index.php b/public/index.php index 9f8ec5f..537367c 100644 --- a/public/index.php +++ b/public/index.php @@ -50,14 +50,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($username)) { throw new Exception("UNKNOWN_USERNAME"); } - if (strlen($username) > 20 || - strlen($username) < 3) { + if (strlen($username) > 20 || strlen($username) < 3) { throw new Exception("USERNAME_INVALID"); } if (!ctype_alnum($username)) { throw new Exception("USERNAME_NOT_ALNUM"); } - if (!strcmp($username, strtolower($username))) { + if (strcmp($username, strtolower($username)) !== 0) { throw new Exception("USERNAME_INVALID"); } if ($storePassword && (!isset($_POST["password"]) || !isset($_POST["password_confirm"]))) {