Merge pull request #779 from aurimasv/proper-to-proxy

Fix properToProxy converter functions
This commit is contained in:
Simon Kornblith 2015-06-29 22:27:15 -04:00
commit 48e6eb93de
2 changed files with 2 additions and 2 deletions

View File

@ -203,7 +203,7 @@ Zotero.Translators = new function() {
} else {
// in Firefox, push the converterFunction
converterFunctions.push(new function() {
var re = new RegExp('^https?://(?:[^/]\\.)?'+Zotero.Utilities.quotemeta(properHosts[j-1])+'/', "gi");
var re = new RegExp('^https?://(?:[^/]\\.)?'+Zotero.Utilities.quotemeta(properHosts[j-1])+'(?=/)', "gi");
var proxyHost = proxyHosts[j-1].replace(/\$/g, "$$$$");
return function(uri) { return uri.replace(re, "$&."+proxyHost) };
});

View File

@ -254,7 +254,7 @@ Zotero.Translators = new function() {
}
} else {
converterFunctions.push(new function() {
var re = new RegExp('^https?://(?:[^/]+\\.)?'+Zotero.Utilities.quotemeta(properHosts[j-1]+'/'), "gi");
var re = new RegExp('^https?://(?:[^/]+\\.)?'+Zotero.Utilities.quotemeta(properHosts[j-1])+'(?=/)', "gi");
var proxyHost = proxyHosts[j-1].replace(/\$/g, "$$$$");
return function(uri) { return uri.replace(re, "$&."+proxyHost) };
});