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;
}

View File

@@ -10,7 +10,7 @@
<li><strong>Small and large images.</strong> All images now get a small and large version.</li>
</ul>
<p><%= link_to("Continue", params[:url] || "/", :id => "tos-agree-link") %></p>
<p><%= link_to("Continue", request.env["HTTP_REFERER"] || "/", :id => "tos-agree-link") %></p>
<!--
<h1>Terms of Service</h1>