Fix #63 by characters restriction

This commit is contained in:
Guillaume Marsay 2020-06-16 13:09:50 +02:00
parent c84267edd8
commit 0115fe7918
1 changed files with 5 additions and 3 deletions

View File

@ -13,10 +13,13 @@ function change_url(loc){
function reload(){
loc = "/" + request_type + "/" + hosts + "/" + proto;
if (request_type != "summary" ){
if( request_args != undefined && request_args != ""){
if( request_args != undefined && request_args != "" && /^[a-zA-Z0-9.:-\\/]*$/.test(request_args)){
$(".request_args").css("border", "");
loc = loc + "?q=" + encodeURIComponent(request_args);
change_url(loc)
}
} else {
$(".request_args").css("border", "solid 1px red");
}
} else {
change_url(loc)
}
@ -102,4 +105,3 @@ $(function(){
});