www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 80d98e0bcb630c9b28303a23290dc1a60d2de566
parent 13958bfabaa8854c6f25907e2d16592a2eb2e641
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon, 30 Jul 2012 19:19:04 -0400

Drop "0-" before the URL on III proxies before attempting subdomain dropping

Diffstat:
Mchrome/content/zotero/xpcom/translation/translator.js | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/translation/translator.js b/chrome/content/zotero/xpcom/translation/translator.js @@ -220,7 +220,10 @@ Zotero.Translators = new function() { // (i.e., www.nature.com.mutex.gmu.edu => www.nature.com) var m = /^(https?:\/\/)([^\/]+)/i.exec(uri); if(m) { - var hostnames = m[2].split("."); + // First, drop the 0- if it exists (this is an III invention) + var host = m[2]; + if(host.substr(0, 2) === "0-") host = substr(2); + var hostnames = host.split("."); for(var i=1; i<hostnames.length-2; i++) { if(TLDS[hostnames[i].toLowerCase()]) { var properHost = hostnames.slice(0, i+1).join(".");