fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2012-02-10 07:27 am

[dw-free] error in LJ::Worker::ProcessSub

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

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

Use the module explicitly so we don't die when we try to compile this in
non-web-context (e.g., esn workers).

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/User.pm
--------------------------------------------------------------------------------
diff -r e4135c489702 -r dc47a29abc6e cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm	Fri Feb 10 13:00:37 2012 +0800
+++ b/cgi-bin/LJ/User.pm	Fri Feb 10 15:12:31 2012 +0800
@@ -3204,7 +3204,13 @@
     my ($url, $name);
     if ($id->typeid eq 'O') {
         $url = $id->value;
-        $name = Net::OpenID::VerifiedIdentity::DisplayOfURL($url, $LJ::IS_DEV_SERVER);
+
+        # load the module conditionally
+        $LJ::OPTMOD_OPENID_VERIFIED_IDENTITY = eval "use Net::OpenID::VerifiedIdentity; 1;"
+            unless defined $LJ::OPTMOD_OPENID_VERIFIED_IDENTITY;
+        $name = Net::OpenID::VerifiedIdentity::DisplayOfURL($url, $LJ::IS_DEV_SERVER)
+            if $LJ::OPTMOD_OPENID_VERIFIED_IDENTITY;
+
         $name = LJ::Hooks::run_hook("identity_display_name", $name) || $name;
 
         ## Unescape %xx sequences
--------------------------------------------------------------------------------