2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 14:04:15 +00:00

fhemweb.js: avoid crash in regexp check (Forum #117259)

git-svn-id: https://svn.fhem.de/fhem/trunk@23453 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-01-01 18:10:12 +00:00
parent 89c3f453a6
commit 084fa0c5e5

View File

@ -1289,13 +1289,17 @@ FW_detailSelect(selEl, mayMissing)
if(selVal != null && selVal != undefined) { if(selVal != null && selVal != undefined) {
for(var i1=0; i1<listArr.length; i1++) { for(var i1=0; i1<listArr.length; i1++) {
var aap = listArr[i1].split(":"); var aap = listArr[i1].split(":");
if(selVal.match(new RegExp("^"+aap[0]+"$"))) { try {
if(aap.length > 2) { if(selVal.match(new RegExp("^"+aap[0]+"$"))) {
var re = aap.shift(); if(aap.length > 2) {
aap = [re, aap.join(":")]; var re = aap.shift();
aap = [re, aap.join(":")];
}
argAndPar = aap;
fnd = true;
} }
argAndPar = aap; } catch(e){
fnd = true; log("Problem building regexp from "+listArr[i1]);
} }
} }
} }