From: erickson Date: Tue, 12 Sep 2006 02:00:16 +0000 (+0000) Subject: stripping port numbers from the location.host string when X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c91d654275632ca5ffe2defcdc523ee494b2151b;p=Evergreen.git stripping port numbers from the location.host string when building opac links - explicit ports were leaking in in some cases (in this case, safari takes a literal :80 from an apache redirect). The opac does not work on non-standard ports as it stands, so no harm done git-svn-id: svn://svn.open-ils.org/ILS/trunk@6070 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index f7728bd8b1..24ffb52767 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -239,7 +239,13 @@ function findBasePath() { function findBaseURL(ssl) { var path = findBasePath(); var proto = (ssl) ? "https:" : "http:"; - return proto + "//" + location.host + path; + + /* strip port numbers. This is necessary for browsers that + send an explicit :80, 443 - explicit ports + break links that need to change ports (e.g. http -> https) */ + var h = location.host.replace(/:.*/,''); + + return proto + "//" + h + path; } /*