From ba83f3a30054359222c941389c84e7f3173e842d Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Tue, 14 Mar 2017 17:21:25 +0000 Subject: [PATCH] fhemweb.js: fix strange set parameters (Forum #68142) git-svn-id: https://svn.fhem.de/fhem/trunk@13701 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/pgm2/fhemweb.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index dc33771db..8eaeb196d 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -640,7 +640,8 @@ FW_inlineModify() // Do not generate a new HTML page upon pressing modify cmd = $(div).attr("cmd"); var sel = $(this).closest("form").find("select"); var arg = $(sel).val(); - var ifid = (devName+"-"+arg).replace(/\./g, '\\.'); + var ifid = (devName+"-"+arg).replace(/([^_a-z0-9])/gi, + function(m){ return "\\"+m }); if($(".dval[informid="+ifid+"]").length == 0) { console.log(this); $(this).unbind('click').click();// No element found to replace, reload @@ -1062,7 +1063,7 @@ function FW_queryValue(cmd, el) { log("FW_queryValue:"+cmd); - var query = location.pathname+"?cmd="+cmd+"&XHR=1"; + var query = location.pathname+"?cmd="+encodeURIComponent(cmd)+"&XHR=1"; query = addcsrf(query); var qConn = new XMLHttpRequest(); qConn.onreadystatechange = function() {