fixes #122: Broken terms of service redirects (404) when browsing to any page except /
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user