From 0115fe7918f223b713fe37b4d9ab3a3599c7be82 Mon Sep 17 00:00:00 2001 From: Guillaume Marsay Date: Tue, 16 Jun 2020 13:09:50 +0200 Subject: [PATCH] Fix #63 by characters restriction --- static/js/lg.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/static/js/lg.js b/static/js/lg.js index 1a8b496..4038579 100644 --- a/static/js/lg.js +++ b/static/js/lg.js @@ -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(){ }); -