aboutsummaryrefslogtreecommitdiffstats
path: root/lib/util.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-09-21 11:29:10 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-09-21 11:29:10 +0200
commitc1a5120e976d18072e80a6086ff0a6a8ef83cb88 (patch)
tree8fd855913382548c107abdae460aea04a6b1e488 /lib/util.js
parenta2f2d22a11b83909de93312856eb3d4c90a68e0b (diff)
downloadbugzilla-triage-c1a5120e976d18072e80a6086ff0a6a8ef83cb88.tar.gz
Adding parsed backtraces seems to be functional. Yuhooo! \o/
* rhbzpage.addNewAttachmentRow finally beaten into submission * util.parseXMLfromString ... it is better to hide this
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/util.js b/lib/util.js
index b258c5f..f9a14c7 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -41,7 +41,7 @@ var getParamsFromURL = exports.getParamsFromURL = function getParamsFromURL (url
if (!url || (url.toString().length === 0)) {
throw new Error("Missing URL value!");
}
-
+
if (!(url instanceof urlMod.URL)) {
url = new urlMod.URL(url.toString(), base);
}
@@ -61,6 +61,20 @@ var getParamsFromURL = exports.getParamsFromURL = function getParamsFromURL (url
};
/**
+ * parse XML object out of string working around various bugs in Gecko implementation
+ * see https://developer.mozilla.org/en/E4X for more information
+ *
+ * @param inStr String with unparsed XML string
+ * @return XML object
+ */
+exports.parseXMLfromString = function parseXMLfromString (inStuff) {
+ // if (typeof inStuff !== 'string') In future we should recognize this.response
+ // and get just .text property out of it. TODO
+ var respStr = inStuff.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, ""); // bug 336551
+ return new XML(respStr);
+};
+
+/**
* Get a bug no from URL ... fails with aliases
* It should theoretically belong to bzpage.js, but we don't have
* unit tests there yet, so keeping here.