diff --git a/app.js b/app.js index e6c4e7149d00c072cbbecce6b21f51eba9b958d4..300e6a97a249ae833bbfce3abaabf88980855d5c 100644 --- a/app.js +++ b/app.js @@ -1048,20 +1048,13 @@ var firmwarewizard = function() { }); // prepare the matches for use in regex (join by pipe and escape dots) - var matchString = matches.join('|').replace(/\./g, '\.'); + var matchString = matches.map(x => x.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'); // match image files. The match either ends with // - a dash or dot (if a file extension will follow) // - the end of the expression (if the file extension is part of the regex) var reMatch = new RegExp('('+matchString+')([.-]|$)'); - // check if image regexes contain regular expressions themself - var reCheckRegex = new RegExp(/[^\\]+[+?*]/); - - if (reCheckRegex.exec(matches.join('|')) !== null) { - console.log("Warning! Some regular expressions for firmware images, contain unescaped characters."); - } - var sitesLoadedSuccessfully = 0; for (var indexPath in config.directories) { // retrieve the contents of the directory diff --git a/devices.js b/devices.js index f9539212909847d35fa9ae94d48931050dc0d1ee..2b38d78e5884c0002899a083d669436f0850cdfd 100644 --- a/devices.js +++ b/devices.js @@ -131,7 +131,7 @@ var devices_recommended = { "UniFi AP AC Pro": "ubiquiti-unifi-ac-pro", "UniFi AP AC Lite": "ubiquiti-unifi-ac-lite", "UniFi AP Outdoor": {"ubiquiti-unifi-outdoor": "", "ubiquiti-unifiap-outdoor": ""}, - "UniFi AP Outdoor+": {"ubiquiti-unifi-outdoor-plus": "", "ubiquiti-unifiap-outdoor\\\+": "", "ubiquiti-unifiap-outdoor%2B": "", "ubiquiti-unifiap-outdoor%2b": ""} + "UniFi AP Outdoor+": {"ubiquiti-unifi-outdoor-plus": "", "ubiquiti-unifiap-outdoor+": "", "ubiquiti-unifiap-outdoor%2B": "", "ubiquiti-unifiap-outdoor%2b": ""} }, "VoCore": {