From a590af9e3a288576d2e416e74a75b12c42e7d7a7 Mon Sep 17 00:00:00 2001 From: FractalParadigm Date: Wed, 12 Mar 2025 19:35:13 -0400 Subject: [PATCH] Fixed HTACCESS to include new username rules. Removed period (.) from allowed username content to prevent URL conflicts --- .gitignore | 1 - .htaccess | 5 +++++ admin/user_management/user_form.php | 2 +- scripts/user_management.js | 2 +- user/create_account.php | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .htaccess diff --git a/.gitignore b/.gitignore index c30629d..0425c84 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ admin/*_db_config.php -.htaccess favicon.ico diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..bcfd75c --- /dev/null +++ b/.htaccess @@ -0,0 +1,5 @@ +RewriteEngine on + +RewriteRule ^/?user/([a-zA-Z0-9\-\_]+)$ /user/user.php?username=$1 [L,NC] + +RewriteRule ^/?tournament/([0-9]+)$ /tournament/tourney.php?tourneyID=$1 [L,NC] diff --git a/admin/user_management/user_form.php b/admin/user_management/user_form.php index e15ec23..8a651df 100644 --- a/admin/user_management/user_form.php +++ b/admin/user_management/user_form.php @@ -59,7 +59,7 @@ try { // Try opening the SQL database connection
- +

diff --git a/scripts/user_management.js b/scripts/user_management.js index 00caf9f..501da66 100644 --- a/scripts/user_management.js +++ b/scripts/user_management.js @@ -107,7 +107,7 @@ function usernameConfirm() { // Temporarily convert the userlist to lower case. This will allow us to compare input vs. saved var listOfUsers = userList.map(e => e.toLowerCase()); - var confirmRegEx = new RegExp("^[a-zA-Z0-9]+([._-]?[a-zA-Z0-9])+([._-]?)$"); + var confirmRegEx = new RegExp("^[a-zA-Z0-9]+([_-]?[a-zA-Z0-9])+([_-]?)$"); // If the username is blank, clear the notice // Otherwise, we'll check the userlist created by PHP which was converted for JS diff --git a/user/create_account.php b/user/create_account.php index 5af01cf..20969fe 100644 --- a/user/create_account.php +++ b/user/create_account.php @@ -67,7 +67,7 @@ try { // Try opening the SQL database connection
- +