fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-08-24 07:21 am

[dw-free] Improve filter error message

[commit: http://hg.dwscoalition.org/dw-free/rev/3962cbc8e80f]

http://bugs.dwscoalition.org/show_bug.cgi?id=3461

Use standard 404/403 pages when we have an invalid filter.

Patch by [staff profile] denise.

Files modified:
  • cgi-bin/Apache/LiveJournal.pm
--------------------------------------------------------------------------------
diff -r 99066b7fd23d -r 3962cbc8e80f cgi-bin/Apache/LiveJournal.pm
--- a/cgi-bin/Apache/LiveJournal.pm	Wed Aug 24 13:13:24 2011 +0800
+++ b/cgi-bin/Apache/LiveJournal.pm	Wed Aug 24 13:46:23 2011 +0800
@@ -1422,22 +1422,12 @@
     elsif ($opts->{'badfriendgroup'})
     {
         # give a real 404 to the journal owner
-        if ($remote && $remote->{'user'} eq $user) {
-            $status = "404 Content filter does not exist";
-            $html = "<h1>Not Found</h1>" .
-                    "<p>The content filter you are trying to access does not exist.</p>";
+        if ( $remote && $remote->{'user'} eq $user ) {
+            return 404;
 
         # otherwise be vague with a 403
         } else {
-            # send back a 403 and don't reveal if the group existed or not
-            $status = "403 Content filter does not exist, or is not public";
-            $html = "<h1>Denied</h1>" .
-                    "<p>Sorry, the content filter you are trying to access does not exist " .
-                    "or is not public.</p>\n";
-
-            $html .= "<p>You're not logged in.  If you're the owner of this journal, " .
-                     "<a href='$LJ::SITEROOT/login.bml'>log in</a> and try again.</p>\n"
-                         unless $remote;
+            return 403;
         }
 
         $generate_iejunk = 1;
--------------------------------------------------------------------------------