console.js/FHEMWEB.pm: check for bad filter (Forum #43111)

git-svn-id: https://svn.fhem.de/fhem/trunk@9703 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-10-28 07:22:39 +00:00
parent 077a33a1d7
commit 02789df29a
2 changed files with 6 additions and 1 deletions

View File

@@ -2466,7 +2466,7 @@ FW_Notify($$)
my $dt = $dev->{TYPE};
for(my $i = 0; $i < $max; $i++) {
my $line = ("$tn $dt $dn ".$events->[$i]."<br>");
push @data,$line if($line =~ m/$h->{filter}/);
eval { push @data,$line if($line =~ m/$h->{filter}/) }
}
}
}

View File

@@ -84,6 +84,11 @@ consStart()
{ text:"Cancel", click:function(){ $(this).dialog('close'); }},
{ text:"OK", click:function(){
var val = $("#filtertext").val().trim();
try {
new RegExp(val ? val : ".*");
} catch(e) {
return FW_okDialog(e);
}
consFilter = val ? val : ".*";
$(this).dialog('close');
$("a#eventFilter").html(consFilter);