Apply modified version of Frank's OpenURL patch: Append '&' if OpenURL resolver URL already has '?' in it

This commit is contained in:
Dan Stillman 2009-11-28 16:37:11 +00:00
parent 99d19f35f7
commit c0b97e339a

View file

@ -76,7 +76,10 @@ Zotero.OpenURL = new function() {
function resolve(itemObject) {
var co = createContextObject(itemObject, Zotero.Prefs.get("openURL.version"));
if(co) {
return Zotero.Prefs.get("openURL.resolver")+"?"+co;
var base = Zotero.Prefs.get("openURL.resolver");
// Add & if there's already a ?
var splice = base.indexOf("?") == -1 ? "?" : "&";
return base + splice + co;
}
return false;
}