瀏覽代碼

Merge branch 'bugs/xpath-namespace-prefix-fix' of https://github.com/MShwed/CyberChef into MShwed-bugs/xpath-namespace-prefix-fix

n1474335 6 年之前
父節點
當前提交
8e3425ed6d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/core/operations/XPathExpression.mjs

+ 1 - 1
src/core/operations/XPathExpression.mjs

@@ -57,7 +57,7 @@ class XPathExpression extends Operation {
 
         let nodes;
         try {
-            nodes = xpath.select(query, doc);
+            nodes = xpath.parse(query).select({ node: doc, allowAnyNamespaceForNoPrefix: true });
         } catch (err) {
             throw new OperationError(`Invalid XPath. Details:\n${err.message}.`);
         }