diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-06 00:56:04 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-06 01:02:22 +0500 |
| commit | 7cc2534f9183bb3116b19ffca52789f1f50900f7 (patch) | |
| tree | a03b240d83b03e3d925061640fdc90084c2c4b18 /public/account/index.php | |
| parent | 91efe9a465df0a6647fbb0f7c5643be89cdcc7e1 (diff) | |
feat: account registration and login
Diffstat (limited to 'public/account/index.php')
| -rw-r--r-- | public/account/index.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/public/account/index.php b/public/account/index.php index ff0b745..8ecce33 100644 --- a/public/account/index.php +++ b/public/account/index.php @@ -16,7 +16,7 @@ if (!isset($_SESSION["user_id"], $_SESSION["user_name"])) { if ($_SERVER['REQUEST_METHOD'] == "POST") { $db = new PDO(DB_URL, DB_USER, DB_PASS); - $username = str_safe($_POST["username"] ?? "", ACCOUNT_USERNAME_MAX_LENGTH); + $username = str_safe($_POST["username"] ?? "", ACCOUNT_USERNAME_LENGTH[1]); if (!empty($username) && $username != $_SESSION["user_name"]) { if (!preg_match(ACCOUNT_USERNAME_REGEX, $username)) { @@ -126,7 +126,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") { username.addEventListener("input", (e) => { const regex = <?php echo ACCOUNT_USERNAME_REGEX ?>; - if (regex.test(e.target.value) && e.target.value.length <= <?php echo ACCOUNT_USERNAME_MAX_LENGTH ?>) { + if (regex.test(e.target.value) && e.target.value.length <= <?php echo ACCOUNT_USERNAME_LENGTH[1] ?>) { validUsername = e.target.value; } else { e.target.value = validUsername; |
