Recognize URI protocol based on RFC 3986 specification

This commit is contained in:
aurimasv 2012-09-14 02:21:54 -05:00
parent d6bd353005
commit b94837d3da

View file

@ -204,7 +204,7 @@ Zotero.Translate.ItemSaver.prototype = {
}, },
"_saveAttachmentFile":function(attachment, parentID) { "_saveAttachmentFile":function(attachment, parentID) {
const urlRe = /(([a-z]+):\/\/[^\s]*)/i; const urlRe = /(([a-z][-+\.a-z0-9]*):\/\/[^\s]*)/i; //according to RFC3986
Zotero.debug("Translate: Adding attachment", 4); Zotero.debug("Translate: Adding attachment", 4);
if(!attachment.url && !attachment.path) { if(!attachment.url && !attachment.path) {