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

[dw-free] warnings roundup for Jan 2011

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

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

Bye warnings.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/LJ/CleanHTML.pm
  • cgi-bin/LJ/Entry.pm
  • cgi-bin/LJ/S2/FriendsPage.pm
--------------------------------------------------------------------------------
diff -r 6bef8e28b060 -r a3b3c0437d59 cgi-bin/LJ/CleanHTML.pm
--- a/cgi-bin/LJ/CleanHTML.pm	Fri Jan 21 07:21:05 2011 -0600
+++ b/cgi-bin/LJ/CleanHTML.pm	Mon Jan 24 14:42:12 2011 +0800
@@ -430,7 +430,8 @@ sub clean
             next if !$@ && !$clean_res;
 
             # this is so the rte converts its source to the standard ljuser html
-            my $ljuser_div = $tag eq "div" && $attr->{class} eq "ljuser";
+            my $ljuser_div = defined $tag && $tag eq "div" &&
+                             defined $attr->{class} && $attr->{class} eq "ljuser";
             if ($ljuser_div) {
                 my $ljuser_text = $p->get_text("/b");
                 $p->get_tag("/div");
diff -r 6bef8e28b060 -r a3b3c0437d59 cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm	Fri Jan 21 07:21:05 2011 -0600
+++ b/cgi-bin/LJ/Entry.pm	Mon Jan 24 14:42:12 2011 +0800
@@ -1392,7 +1392,7 @@ sub get_log2_recent_log
     my $use_cache = 1;
 
     # timestamp
-    $events_date = int $events_date;
+    $events_date = ( ! defined $events_date || $events_date eq "" ) ? 0 : int $events_date;
     $use_cache = 0 if $events_date; # do not use memcache for dayly friends log
 
     my $memkey  = [$jid, "log2lt:$jid"];
diff -r 6bef8e28b060 -r a3b3c0437d59 cgi-bin/LJ/S2/FriendsPage.pm
--- a/cgi-bin/LJ/S2/FriendsPage.pm	Fri Jan 21 07:21:05 2011 -0600
+++ b/cgi-bin/LJ/S2/FriendsPage.pm	Mon Jan 24 14:42:12 2011 +0800
@@ -261,12 +261,14 @@ sub FriendsPage
     $base .= "/" . LJ::eurl( $group_name )
         if $group_name;
 
+    # these are the same for both previous and next links
+    my %linkvars;
+    $linkvars{show} = $get->{show} if defined $get->{show} && $get->{show} =~ /^\w+$/;
+    $linkvars{date} = $get->{date} if $get->{date};
+    $linkvars{filter} = $get->{filter} + 0 if defined $get->{filter};
+
     # if we've skipped down, then we can skip back up
     if ($skip) {
-        my %linkvars;
-        $linkvars{'show'} = $get->{'show'} if $get->{'show'} =~ /^\w+$/;
-        $linkvars{'date'} = $get->{date} if $get->{date};
-        $linkvars{filter} = $get->{filter}+0 if defined $get->{filter};
         my $newskip = $skip - $itemshow;
         if ($newskip > 0) { $linkvars{'skip'} = $newskip; }
         else { $newskip = 0; }
@@ -281,10 +283,6 @@ sub FriendsPage
     ## on the page, but who cares about that ... well, we do now...)
     # Must remember to count $hiddenentries or we'll have no skiplinks when > 1
     unless (($eventnum + $hiddenentries) != $itemshow || $skip == $maxskip || !$is_prev_exist) {
-        my %linkvars;
-        $linkvars{'show'} = $get->{'show'} if $get->{'show'} =~ /^\w+$/;
-        $linkvars{'date'} = $get->{'date'} if $get->{'date'};
-        $linkvars{filter} = $get->{filter}+0 if defined $get->{filter};
         my $newskip = $skip + $itemshow;
         $linkvars{'skip'} = $newskip;
         $nav->{'backward_url'} = LJ::make_link($base, \%linkvars);
--------------------------------------------------------------------------------