diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index c8ae27a311..09fcfe2847 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -2842,9 +2842,8 @@ Zotero.Attachments = new function(){ this._getExtensionFromURL = function(url, contentType) { - var nsIURL = Components.classes["@mozilla.org/network/standard-url;1"] - .createInstance(Components.interfaces.nsIURL); - nsIURL.spec = url; + var nsIURL = Services.io.newURI(url) + .QueryInterface(Ci.nsIURL); return Zotero.MIME.getPrimaryExtension(contentType, nsIURL.fileExtension); }