From c77c7ca17db892f503b6937855289e5e76b90250 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 13 Jan 2012 18:40:02 -0500 Subject: [PATCH] Throw error when attempting to install style that isn't XML Also remove redundant "new XML()" call, which cleanXML() does itself. --- chrome/content/zotero/xpcom/style.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js index 1ca18a93b..e62dbef4b 100644 --- a/chrome/content/zotero/xpcom/style.js +++ b/chrome/content/zotero/xpcom/style.js @@ -169,7 +169,10 @@ Zotero.Styles = new function() { var xml = enConverter.parse(); } else { // CSL - var xml = new XML(this.cleanXML(style)); + var xml = this.cleanXML(style); + if (!xml.name()) { + throw new Error("File is not XML"); + } } } catch(e) { error = e;