mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
fhemweb.js: avoid crash on buggy attribute names (Forum #116235)
git-svn-id: https://svn.fhem.de/fhem/trunk@23262 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
212c02c31c
commit
4bc1553518
@ -1535,8 +1535,8 @@ FW_doDetail($)
|
|||||||
sort map { $_ =~ s/ /#/g ;$_} keys %FW_rooms);
|
sort map { $_ =~ s/ /#/g ;$_} keys %FW_rooms);
|
||||||
my $groupList = "multiple,".join(",",
|
my $groupList = "multiple,".join(",",
|
||||||
sort map { $_ =~ s/ /#/g ;$_} keys %FW_groups);
|
sort map { $_ =~ s/ /#/g ;$_} keys %FW_groups);
|
||||||
$attrList =~ s/room /room:$roomList /;
|
$attrList =~ s/\broom\b/room:$roomList/;
|
||||||
$attrList =~ s/group /group:$groupList /;
|
$attrList =~ s/\bgroup\b/group:$groupList/;
|
||||||
$attrList = FW_widgetOverride($d, $attrList);
|
$attrList = FW_widgetOverride($d, $attrList);
|
||||||
$attrList =~ s/\\/\\\\/g;
|
$attrList =~ s/\\/\\\\/g;
|
||||||
$attrList =~ s/'/\\'/g;
|
$attrList =~ s/'/\\'/g;
|
||||||
|
@ -307,12 +307,15 @@ FW_jqueryReadyFn()
|
|||||||
$("#content")
|
$("#content")
|
||||||
.append("<div id='workbench' style='display:none'></div>");
|
.append("<div id='workbench' style='display:none'></div>");
|
||||||
$("#content > #workbench").html(data);
|
$("#content > #workbench").html(data);
|
||||||
|
|
||||||
var mtype = $("#content > #workbench a[name]").attr("name"), aTag;
|
var mtype = $("#content > #workbench a[name]").attr("name"), aTag;
|
||||||
if(mtype)
|
if(mtype) {
|
||||||
aTag = $("#content > #workbench").find("a[name="+mtype+val+"]");
|
var mv = (mtype+val).replaceAll(/[^a-z0-9_]/ig,'_')
|
||||||
if(!$(aTag).length) // old style syntax without type
|
aTag = $("#content > #workbench").find("a[name="+mv+"]");
|
||||||
aTag = $("#content > #workbench").find("a[name="+val+"]");
|
}
|
||||||
|
if(!$(aTag).length) { // old style syntax without type
|
||||||
|
var v = (val).replaceAll(/[^a-z0-9_]/ig,'_')
|
||||||
|
aTag = $("#content > #workbench").find("a[name="+v+"]");
|
||||||
|
}
|
||||||
if($(aTag).length) {
|
if($(aTag).length) {
|
||||||
var liTag = $(aTag).next("li");
|
var liTag = $(aTag).next("li");
|
||||||
if(!$(liTag).length)
|
if(!$(liTag).length)
|
||||||
|
Loading…
Reference in New Issue
Block a user