Merge pull request #15111 from nextcloud/backport/15110/stable16
[stable16] Make sure we have a proper node before parsing
This commit is contained in:
commit
9b6d4c4a4f
1 changed files with 5 additions and 0 deletions
|
@ -82,6 +82,11 @@
|
|||
var parts = name.split(':');
|
||||
var tagName = parts[1];
|
||||
var namespace = resolver(parts[0]);
|
||||
// make sure we can get elements
|
||||
if (typeof node === 'string') {
|
||||
var parser = new DOMParser()
|
||||
node = parser.parseFromString(node, 'text/xml')
|
||||
}
|
||||
if (node.getElementsByTagNameNS) {
|
||||
return node.getElementsByTagNameNS(namespace, tagName);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue