From 4b432845c6e7f1b14e4db4da46e231ea7ed28904 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 16 Jan 2017 09:01:48 +0000 Subject: [PATCH] 01_FHEMWEB.js: avoid converting of csrf to Float. fhemweb.js: avoid JS-Error if Websocket does not work (Forum #64541) git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@13103 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/01_FHEMWEB.pm | 2 +- www/pgm2/console.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/FHEM/01_FHEMWEB.pm b/FHEM/01_FHEMWEB.pm index 15eaabb07..4176b0ce6 100755 --- a/FHEM/01_FHEMWEB.pm +++ b/FHEM/01_FHEMWEB.pm @@ -275,7 +275,7 @@ FW_Define($$) InternalTimer(1, sub(){ if($featurelevel >= 5.8 && !AttrVal($name, "csrfToken", undef)) { my ($x,$y) = gettimeofday(); - $hash->{CSRFTOKEN} = rand($y)*rand($x); + $hash->{CSRFTOKEN} = "fhem_".(rand($y)*rand($x)); } }, $hash, 0); diff --git a/www/pgm2/console.js b/www/pgm2/console.js index d6adcc9fc..4b9a454e2 100644 --- a/www/pgm2/console.js +++ b/www/pgm2/console.js @@ -41,6 +41,8 @@ consUpdate(evt) new_content = consConn.responseText.substring(consLastIndex, len); consLastIndex = len; } + if(new_content == undefined || new_content.length == 0) + return; log("Console Rcvd: "+new_content); if(new_content.indexOf('<') != 0) new_content = new_content.replace(/ /g, " ");