Fixed HTACCESS to include new username rules. Removed period (.) from allowed username content to prevent URL conflicts

This commit is contained in:
FractalParadigm 2025-03-12 19:35:13 -04:00
parent eb591d9902
commit a590af9e3a
5 changed files with 8 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,3 +1,2 @@
admin/*_db_config.php
.htaccess
favicon.ico

5
.htaccess Normal file
View File

@ -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]

View File

@ -59,7 +59,7 @@ try { // Try opening the SQL database connection
<!-- THIS DIV IS FOR INPUT -->
<div id="textInputArea">
<label for="username" class="inputLabel" >Username:</label>
<input type="text" id="username" name="username" class="newLine" maxlength="30" oninput="usernameConfirm()" tabindex="1" pattern="^[a-zA-Z0-9]+([._\-]?[a-zA-Z0-9])+([._\-]?)$" required>
<input type="text" id="username" name="username" class="newLine" maxlength="30" oninput="usernameConfirm()" tabindex="1" pattern="^[a-zA-Z0-9]+([_\-]?[a-zA-Z0-9])+([_\-]?)$" required>
<p id="confirmUsername"></p>
<label for="password" class="inputLabel newLine">Password:</label>
<input type="password" id="password" name="password" minlength="6" oninput="checkPasswordRequirements()" required/>

View File

@ -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

View File

@ -67,7 +67,7 @@ try { // Try opening the SQL database connection
<!-- THIS DIV IS FOR INPUT -->
<div id="textInputArea">
<label for="username" class="inputLabel" id="usernameLabel">Username:&nbsp;&nbsp;<span id="confirmUsername"></span></label>
<input type="text" id="username" name="username" class="newLine" maxlength="30" oninput="usernameConfirm()" tabindex="1" pattern="^[a-zA-Z0-9]+([._\-]?[a-zA-Z0-9])+([._\-]?)$" required>
<input type="text" id="username" name="username" class="newLine" maxlength="30" oninput="usernameConfirm()" tabindex="1" pattern="^[a-zA-Z0-9]+([_\-]?[a-zA-Z0-9])+([_\-]?)$" required>
<label for="password" class="inputLabel">Password:</label>
<input type="password" id="password" name="password" required oninput="checkPasswordRequirements()" tabindex="1">
<p class="newLine"></p>