Allow additional characters in URL scheme for attachments/launchURL()
https://forums.zotero.org/discussion/comment/345977/#Comment_345977
This commit is contained in:
parent
066ec123d0
commit
857c42c40b
2 changed files with 4 additions and 2 deletions
chrome/content/zotero/xpcom
|
@ -606,7 +606,8 @@ Zotero.Attachments = new function(){
|
||||||
var title = options.title;
|
var title = options.title;
|
||||||
var collections = options.collections;
|
var collections = options.collections;
|
||||||
|
|
||||||
var matches = url.match(/^([a-z]+):(\/\/)?.+/);
|
var schemeRE = /^([a-z][a-z0-9+.-]+):/;
|
||||||
|
var matches = url.match(schemeRE);
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
throw new Error(`Invalid URL '${url}'`);
|
throw new Error(`Invalid URL '${url}'`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1032,7 +1032,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
}
|
}
|
||||||
// Launch non-HTTP URLs
|
// Launch non-HTTP URLs
|
||||||
else {
|
else {
|
||||||
let matches = url.match(/^([a-z]+):/);
|
let schemeRE = /^([a-z][a-z0-9+.-]+):/;
|
||||||
|
let matches = url.match(schemeRE);
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
throw new Error(`Invalid URL '${url}'`);
|
throw new Error(`Invalid URL '${url}'`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue