fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-06-21 11:08 am

[dw-free] Error when loading a journal page which has a list of tags (dev environment only)

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

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

Check that we passed in a remote, and the remote is a valid user.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/Tags.pm
--------------------------------------------------------------------------------
diff -r 138f3a485251 -r 431678cf7880 cgi-bin/LJ/Tags.pm
--- a/cgi-bin/LJ/Tags.pm	Mon Jun 21 17:31:26 2010 +0800
+++ b/cgi-bin/LJ/Tags.pm	Mon Jun 21 19:14:41 2010 +0800
@@ -290,7 +290,7 @@ sub get_usertags {
 
     # now if they provided a remote, remove the ones they don't want to see; note that
     # remote may be undef so we have to check exists
-    if ( exists $opts->{remote} ) {
+    if ( exists $opts->{remote} && LJ::isu( $opts->{remote} ) ) {
         # never going to cull anything if you control it, so just return
         return $res if $opts->{remote}->can_manage( $u );
 
--------------------------------------------------------------------------------
kareila: Taking refuge from falling debris under a computer desk. (computercrash)

[personal profile] kareila 2010-06-22 06:28 am (UTC)(link)
Hey Fu, I don't think the logic works out the same. I think the exists check needs to stay as is and instead do:

return $res if $opts->{remote} && $opts->{remote}->can_manage( $u );

Otherwise the rest of the block after that won't be executed for logged out users.