Added validation on unsupported chars for UUID like "/<>?!" etc.
This commit is contained in:
@@ -276,10 +276,18 @@ async function fetchUUIDCheck(givenUUID , strategy){
|
|||||||
return newUUID ;
|
return newUUID ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkUUIDChars(uuid) {
|
||||||
|
const regex = new RegExp("/^[A-z0-9-]+$/");
|
||||||
|
if(regex.test(uuid)){
|
||||||
|
return uuid ;
|
||||||
|
}
|
||||||
|
return "invalid";
|
||||||
|
}
|
||||||
|
|
||||||
function changeUUID(element){
|
function changeUUID(element){
|
||||||
|
|
||||||
const uuidStrategy = $('input[name="uuid-validation-type"]:checked').val();
|
const uuidStrategy = $('input[name="uuid-validation-type"]:checked').val();
|
||||||
const givenUUID = element.value ;
|
const givenUUID = checkUUIDChars(element.value);
|
||||||
|
|
||||||
if( givenUUID == clientUUID ){
|
if( givenUUID == clientUUID ){
|
||||||
uuidChangeModalDisplay("noChg");
|
uuidChangeModalDisplay("noChg");
|
||||||
@@ -294,12 +302,12 @@ function changeUUID(element){
|
|||||||
changeMessage = "success";
|
changeMessage = "success";
|
||||||
}
|
}
|
||||||
clientUUID = data;
|
clientUUID = data;
|
||||||
|
$("#uuid-input").attr("disabled", true);
|
||||||
|
$("#editable").attr("checked", false);
|
||||||
|
|
||||||
uuidChangeModalDisplay(changeMessage);
|
uuidChangeModalDisplay(changeMessage);
|
||||||
document.cookie = C_UUID + '=' + data ;
|
document.cookie = C_UUID + '=' + data ;
|
||||||
} )
|
} )
|
||||||
$("#uuid-input").attr("disabled", true);
|
|
||||||
$("#editable").attr("checked", false);
|
|
||||||
loadCookies();
|
loadCookies();
|
||||||
refreshData();
|
refreshData();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user