fixes #122: Broken terms of service redirects (404) when browsing to any page except /

This commit is contained in:
albert
2011-10-14 14:35:18 -04:00
parent 4abf66cf44
commit a7f9464cc2
2 changed files with 3 additions and 3 deletions

View File

@@ -50,10 +50,10 @@
loc = loc.replace(/^https?:\/\/[^\/]+/, "")
}
if (loc.match(/^\/(comment|pool|note|post)/) && this.get("tos") != "1") {
if (!loc.match(/\/static\/terms_of_service/) && this.get("tos") != "1") {
// Setting location.pathname in Safari doesn't work, so manually extract the domain.
var domain = location.href.match(/^(https?:\/\/[^\/]+)/)[0];
location.href = domain + "/terms_of_service?url=" + encodeURIComponent(location.href);
location.href = domain + "/static/terms_of_service";
return;
}