From 3649e03d8fc4473a247a816d85dd996144404027 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:48:40 +0300 Subject: [PATCH] some changes --- app/Controllers/Api/Register.php | 4 ++-- views/components/Navbar.php | 39 -------------------------------- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/app/Controllers/Api/Register.php b/app/Controllers/Api/Register.php index 3940e4a..577ba9a 100644 --- a/app/Controllers/Api/Register.php +++ b/app/Controllers/Api/Register.php @@ -36,8 +36,8 @@ class Register $username = $_POST['username']; $password = $_POST['password']; $email = $_POST['email']; - if (!strcasecmp(DB::query('SELECT username FROM users WHERE (LOWER(username) LIKE :username)', array(':username' => '%' . $username . '%'))[0]['username'], $username) === false || Router::checkCurl($_SERVER['HTTP_HOST'] . '/' . $username) != 200 ) { - if (Word::strlen(ltrim($username)) >= 5 && Word::strlen(ltrim($username)) <= 20 && !preg_match("#^[a-zA-Z0-9]+$#", $username)) { + if (!strcasecmp(DB::query('SELECT username FROM users WHERE (LOWER(username) LIKE :username)', array(':username' => '%' . $username . '%'))[0]['username'], $username) === false) { + if (Word::strlen(ltrim($username)) >= 5 && Word::strlen(ltrim($username)) <= 20) { if (Word::strlen(ltrim($password)) >= 5 && Word::strlen(ltrim($password)) <= 120) { diff --git a/views/components/Navbar.php b/views/components/Navbar.php index 53097f5..b9ff55d 100644 --- a/views/components/Navbar.php +++ b/views/components/Navbar.php @@ -1,44 +1,6 @@