mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2010-05-02 05:37 am

[dw-free] show=P, etc not always displaying the current view for the navstrip on the read page

[commit: http://hg.dwscoalition.org/dw-free/rev/01fa81116200]

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

Less strict checking on the inputs to make the navbar select the right item
in the dropdown in more cases.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/weblib.pl
--------------------------------------------------------------------------------
diff -r ae3c6b7debb8 -r 01fa81116200 cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl	Sun May 02 05:35:12 2010 +0000
+++ b/cgi-bin/weblib.pl	Sun May 02 05:37:39 2010 +0000
@@ -2787,16 +2787,16 @@ sub control_strip
 
                 my $selected = "all";
                 if ($r->uri eq "/read" && $r->query_string ne "") {
-                    $selected = "showpeople"      if $r->query_string eq "show=P&filter=0";
-                    $selected = "showcommunities" if $r->query_string eq "show=C&filter=0";
-                    $selected = "showsyndicated"  if $r->query_string eq "show=F&filter=0";
+                    $selected = "showpeople"      if $r->query_string =~ /\bshow=P\b/;
+                    $selected = "showcommunities" if $r->query_string =~ /\bshow=C\b/;
+                    $selected = "showsyndicated"  if $r->query_string =~ /\bshow=F\b/;
                 } elsif ($r->uri =~ /^\/read\/?(.+)?/i) {
                     my $filter = $1 || "default view";
                     $selected = "filter:" . LJ::durl( lc( $filter ) );
                 } elsif ($r->uri eq "/network" && $r->query_string ne "") {
-                    $selected = "showpeople"      if $r->query_string eq "show=P&filter=0";
-                    $selected = "showcommunities" if $r->query_string eq "show=C&filter=0";
-                    $selected = "showsyndicated"  if $r->query_string eq "show=F&filter=0";
+                    $selected = "showpeople"      if $r->query_string =~ /\bshow=P\b/;
+                    $selected = "showcommunities" if $r->query_string =~ /\bshow=C\b/;
+                    $selected = "showsyndicated"  if $r->query_string =~ /\bshow=F\b/;
                 }
 
                 $ret .= "$links{'manage_friends'}   ";
--------------------------------------------------------------------------------