This shouldn't happen, but it does, so take it into account before 
putting it into memcache. Othewrwise, it interferes with our aability to pull 
the data back out again (Thanks to <user name="exor674"> for working with me on 
debugging this!)

        Patch by fu. 

diffs (24 lines):

diff -r 6a02b7b7a1b1 -r 80c58c8a06db cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm        Mon Nov 15 13:01:18 2010 +0800
+++ b/cgi-bin/LJ/User.pm        Mon Nov 15 15:54:42 2010 +0800
@@ -6906,6 +6906,10 @@ sub get_userpic_info {
         my %picmap;
         my %kwmap;
         while (my ($kw, $id, $mapid, $redir) = $sth->fetchrow_array) {
+
+            # used to be a bug that allowed these to get in.
+            next if $kw =~ /[\n\r\0]/ || ( defined $kw && length($kw) == 0 );
+
             my $skip_kw = 0;
             if ( $mapped_icons ) {
                 $picmap{$mapid} = [ int($id), int($redir) ];
@@ -6921,8 +6925,8 @@ sub get_userpic_info {
                 }
             }
             next if $skip_kw;
+
             next unless $info->{pic}->{$id};
-            next if $kw =~ /[\n\r\0]/;  # used to be a bug that allowed these 
to get in.
             $info->{kw}->{$kw} = $info->{pic}->{$id};
             $info->{mapid}->{$mapid} = $info->{pic}->{$id} if $mapped_icons && 
$id;
             $minfokw{$kw} = int($id);
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to