mirror of
https://github.com/openwrt/luci.git
synced 2025-12-27 05:24:58 +04:00
luci.js: remove unsafe fallback code from dom.parse()
Do not fallback to .innerHTML if DOMParser() failed for whatever reason. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
@@ -1248,7 +1248,7 @@
|
||||
* `null` on parsing failures or if no element could be found.
|
||||
*/
|
||||
parse: function(s) {
|
||||
var elem;
|
||||
var elem = null;
|
||||
|
||||
try {
|
||||
domParser = domParser || new DOMParser();
|
||||
@@ -1256,16 +1256,7 @@
|
||||
}
|
||||
catch(e) {}
|
||||
|
||||
if (!elem) {
|
||||
try {
|
||||
dummyElem = dummyElem || document.createElement('div');
|
||||
dummyElem.innerHTML = s;
|
||||
elem = dummyElem.firstChild;
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
|
||||
return elem || null;
|
||||
return elem;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user