projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
db88156
)
luci.js: remove unsafe fallback code from dom.parse()
author
Jo-Philipp Wich
<jo@mein.io>
Thu, 23 Dec 2021 16:09:13 +0000
(17:09 +0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Thu, 23 Dec 2021 16:10:18 +0000
(17:10 +0100)
Do not fallback to .innerHTML if DOMParser() failed for whatever reason.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit
63d9bcb6825fac92fd7dfa4ba858c8d5aafa23e8
)
modules/luci-base/htdocs/luci-static/resources/luci.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/luci.js
b/modules/luci-base/htdocs/luci-static/resources/luci.js
index 23853e2cc89eb3363c0ff6b8163a5a08944722c9..b06688ea29421891b97179e649fe8872b221baa6 100644
(file)
--- a/
modules/luci-base/htdocs/luci-static/resources/luci.js
+++ b/
modules/luci-base/htdocs/luci-static/resources/luci.js
@@
-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;
},
/**