fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2012-01-06 03:00 pm

[dw-free] Manage Icons: make keyword sorting case-insensitive, as on the Icons page

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

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

Sort by keyword case-insensitively.

Patch by [personal profile] yvi.

Files modified:
  • cgi-bin/LJ/Userpic.pm
--------------------------------------------------------------------------------
diff -r 55f58f915b56 -r 3df03264ab61 cgi-bin/LJ/Userpic.pm
--- a/cgi-bin/LJ/Userpic.pm	Fri Jan 06 22:40:57 2012 +0800
+++ b/cgi-bin/LJ/Userpic.pm	Fri Jan 06 23:01:18 2012 +0800
@@ -493,7 +493,7 @@
         # if scalar context return comma-seperated list of keywords, or "pic#12345" if no keywords
         return ($raw ? '' : "pic#" . $self->id) unless @pickeywords;
 
-        return join(', ', sort @pickeywords);
+        return join(', ', sort { lc $a cmp lc $b } @pickeywords);
     }
 }
 
@@ -1260,8 +1260,8 @@
             $nokwhash{$pickw} = $pic;
         }
     }
-    my @sortedkw = sort keys %kwhash;
-    my @sortednokw = sort keys %nokwhash;
+    my @sortedkw = sort { lc $a cmp lc $b } keys %kwhash;
+    my @sortednokw = sort { lc $a cmp lc $b } keys %nokwhash;
 
     my @sortedpics;
     foreach my $kw ( @sortedkw ) {
--------------------------------------------------------------------------------