www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 056547f0c0aec939d5d5f6078377b940eeb14d27
parent 57c3d190b4284c95ccbec08a4ddbbb2787877bc9
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon, 25 Jun 2012 01:00:51 -0400

Merge branch 'kill-e4x'

Diffstat:
Mchrome/content/zotero/xpcom/style.js | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js @@ -174,8 +174,8 @@ Zotero.Styles = new function() { var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"] .createInstance(Components.interfaces.nsIDOMParser), doc = parser.parseFromString(style, "application/xml"); - if (!doc.documentElement.localName) { - throw new Error("File is not XML"); + if(doc.documentElement.localName === "parsererror") { + throw new Error("File is not valid XML"); } } catch(e) { error = e; @@ -367,6 +367,9 @@ Zotero.Style = function(arg) { parser = Components.classes["@mozilla.org/xmlextras/domparser;1"] .createInstance(Components.interfaces.nsIDOMParser), doc = parser.parseFromString(style, "application/xml"); + if(doc.documentElement.localName === "parsererror") { + throw new Error("File is not valid XML"); + } this.styleID = Zotero.Utilities.xpathText(doc, '/csl:style/csl:info[1]/csl:id[1]', Zotero.Styles.ns);