wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r23319: LJSUP-14299: Filtered tag page

Committer: wisest-owl
LJSUP-14299: Filtered tag page

U   trunk/cgi-bin/LJ/S2/RecentPage.pm
U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/S2/RecentPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/RecentPage.pm	2012-11-16 13:43:52 UTC (rev 23318)
+++ trunk/cgi-bin/LJ/S2/RecentPage.pm	2012-11-19 10:36:29 UTC (rev 23319)
@@ -40,9 +40,9 @@
 
         $p->{'tagfilter_active'} = 1;
         $p->{'tagfilter_mode'}   = $opts->{'tagmode'};
-        while ( my ( $tagname, $tagid ) = each %{ $opts->{'tagmap'} } ) {
+        while ( my ( $tagname, $tagids ) = each %{ $opts->{'tagmap'} } ) {
             push @{ $p->{'tagfilter_tags'} },
-                LJ::S2::Tag( $u, $tagid, $tagname );
+                LJ::S2::Tag( $u, $tagids->[0], $tagname );
         }
     }
 
@@ -112,7 +112,7 @@
         'poster'  => $get->{'poster'} || '',
         'show_sticky_on_top' => 1,
     }) if ($itemshow >= 0) ;
-    
+
     my $is_prev_exist = scalar @items - $itemshow > 0 ? 1 : 0;
     if ($is_prev_exist) {
         if ( scalar(@items) > $itemshow ) {        

Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2012-11-16 13:43:52 UTC (rev 23318)
+++ trunk/cgi-bin/LJ/User.pm	2012-11-19 10:36:29 UTC (rev 23319)
@@ -10147,9 +10147,14 @@
         $opts->{tagids} = [];
         $opts->{'tagmap'} = {};
         my $tags = LJ::Tags::get_usertags($u, { remote => $remote });
-        my %kwref = ( map { $tags->{$_}->{name} => $_ } keys %{$tags || {}} );
+
+        my %kwref = ();
+        foreach my $tagid (keys %$tags) {
+            push @{$kwref{LJ::Text->normalize_tag_name ($tags->{$tagid}->{'name'})}}, $tagid;
+        }
+
         foreach my $tagname (@{$opts->{tags}}) {
-            unless ($kwref{$tagname}) {
+            unless ($kwref{LJ::Text->normalize_tag_name ($tagname)}) {
                 LJ::Request->pnotes ('error' => 'e404');
                 LJ::Request->pnotes ('remote' => LJ::get_remote ());
                 $opts->{'handler_return'} = "404 Not Found";
@@ -10157,8 +10162,8 @@
             }
             #return $error->("Sorry, one or more specified tags do not exist.", "404 Not Found")
             #    unless $kwref{$tagname};
-            push @{$opts->{tagids}}, $kwref{$tagname};
-            $opts->{'tagmap'}->{$tagname} = $kwref{$tagname};
+            push @{$opts->{'tagids'}}, @{$kwref{LJ::Text->normalize_tag_name ($tagname)}};
+            $opts->{'tagmap'}->{$tagname} = $kwref{LJ::Text->normalize_tag_name ($tagname)};
         }
 
         $opts->{tagmode} = $opts->{getargs}->{mode} eq 'and' ? 'and' : 'or';
@@ -10200,7 +10205,7 @@
     }
 
     unless ($geta->{'viewall'} && LJ::check_priv($remote, "canview", "suspended") ||
-            $opts->{'pathextra'} =~ m#/(\d+)/stylesheet$#) { # don't check style sheets
+            $opts->{'pathextra'} =~ m#/(\d+)/stylesheet$#) { ## don't check style sheets
         if ($u->is_deleted){
             my $warning = LJ::Lang::get_text(LJ::Lang::get_effective_lang(), 
                                     'journal.deleted', undef, {username => $u->username})

Tags: livejournal, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments