Skip to content

Commit

Permalink
2.11.8: Updated regex for username in forms
Browse files Browse the repository at this point in the history
  • Loading branch information
webpwnized committed Dec 17, 2023
1 parent 5b6703d commit ea1737e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion edit-account-profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
function onSubmitOfForm(/*HTMLFormElement*/ theForm){
try{
if(lValidateInput == "TRUE"){
var lUnsafeCharacters = /[`~!@#$%^&*()-_=+\[\]{}\\|;':",./<>?]/;
var lUnsafeCharacters = /[\W]/g;
if (theForm.username.value.length > 15){
alert('Username too long. We dont want to allow too many characters.\n\nSomeone might have enough room to enter a hack attempt.');
return false;
Expand Down
2 changes: 1 addition & 1 deletion html5-storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ interface Storage {
var lKey = theForm.DOMStorageKey.value;
var lItem = theForm.DOMStorageItem.value;
var lType = "";
var lUnacceptableKeyPattern = "[^A-Za-z0-9]";
var lUnacceptableKeyPattern = "[\W]";

if (gUseJavaScriptValidation == "TRUE" && lKey.match(lUnacceptableKeyPattern)){
setMessage("Unable to add key " + lKey.toString() + " because it contains non-alphanumeric characters");
Expand Down
2 changes: 1 addition & 1 deletion includes/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* ------------------------------------------
* @VERSION
* ------------------------------------------*/
$C_VERSION = "2.11.7";
$C_VERSION = "2.11.8";
$C_VERSION_STRING = "Version: " . $C_VERSION;
$C_MAX_HINT_LEVEL = 1;

Expand Down
2 changes: 1 addition & 1 deletion login.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
function onSubmitOfLoginForm(/*HTMLFormElement*/ theForm){
try{
if(lValidateInput == "TRUE"){
var lUnsafeCharacters = /[`~!@#$%^&*()-_=+\[\]{}\\|;':",./<>?]/;
var lUnsafeCharacters = /[\W]/g;
if (theForm.username.value.length > 15){
alert('Username too long. We dont want to allow too many characters.\n\nSomeone might have enough room to enter a hack attempt.');
return false;
Expand Down
2 changes: 1 addition & 1 deletion register.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
function onSubmitOfForm(/*HTMLFormElement*/ theForm){
try{
if(lValidateInput == "TRUE"){
var lUnsafeCharacters = /[`~!@#$%^&*()-_=+\[\]{}\\|;':",./<>?]/;
var lUnsafeCharacters = /[\W]/g;
if (theForm.username.value.length > 15 ||
theForm.password.value.length > 15){
alert('Username too long. We dont want to allow too many characters.\n\nSomeone might have enough room to enter a hack attempt.');
Expand Down
2 changes: 1 addition & 1 deletion user-info-xpath.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

function onSubmitOfForm(/*HTMLFormElement*/ theForm){
try{
var lUnsafeCharacters = /[`~!@#$%^&*()-_=+\[\]{}\\|;':",./<>?]/;
var lUnsafeCharacters = /[\W]/g;

if(lValidateInput == "TRUE"){
if (theForm.username.value.length > 15){
Expand Down
4 changes: 2 additions & 2 deletions user-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@

function onSubmitOfForm(/*HTMLFormElement*/ theForm){
try{
var lUnsafeCharacters = /[`~!@#$%^&*()-_=+\[\]{}\\|;':",./<>?]/;
var lUnsafeCharacters = /[\W]/g;

if(lValidateInput == "TRUE"){
if (theForm.username.value.length > 15){
alert('Username too long. We dont want to allow too many characters.\n\nSomeone might have enough room to enter a hack attempt.');
return false;
}// end if

if (theForm.username.value.search(lUnsafeCharacters) > -1){
alert('Dangerous characters detected. We can\'t allow these. This all powerful blacklist will stop such attempts.\n\nMuch like padlocks, filtering cannot be defeated.\n\nBlacklisting is l33t like l33tspeak.');
return false;
Expand Down

0 comments on commit ea1737e

Please sign in to comment.