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 ;
|
||||
}
|
||||
|
||||
function checkUUIDChars(uuid) {
|
||||
const regex = new RegExp("/^[A-z0-9-]+$/");
|
||||
if(regex.test(uuid)){
|
||||
return uuid ;
|
||||
}
|
||||
return "invalid";
|
||||
}
|
||||
|
||||
function changeUUID(element){
|
||||
|
||||
const uuidStrategy = $('input[name="uuid-validation-type"]:checked').val();
|
||||
const givenUUID = element.value ;
|
||||
const givenUUID = checkUUIDChars(element.value);
|
||||
|
||||
if( givenUUID == clientUUID ){
|
||||
uuidChangeModalDisplay("noChg");
|
||||
@@ -294,12 +302,12 @@ function changeUUID(element){
|
||||
changeMessage = "success";
|
||||
}
|
||||
clientUUID = data;
|
||||
$("#uuid-input").attr("disabled", true);
|
||||
$("#editable").attr("checked", false);
|
||||
|
||||
uuidChangeModalDisplay(changeMessage);
|
||||
document.cookie = C_UUID + '=' + data ;
|
||||
} )
|
||||
$("#uuid-input").attr("disabled", true);
|
||||
$("#editable").attr("checked", false);
|
||||
loadCookies();
|
||||
refreshData();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user