]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/openid.pm
Changelog
[git.ikiwiki.info.git] / IkiWiki / Plugin / openid.pm
index e3b9982f2d3bbf4d5185ae7a1b97c850f6cdaa89..384af7e98965d520f58bd21ee87ccaceaa16ba48 100644 (file)
@@ -119,7 +119,9 @@ sub validate ($$$;$) {
        my $claimed_identity = $csr->claimed_identity($openid_url);
        if (! $claimed_identity) {
                if ($errhandler) {
-                       $errhandler->($csr->err);
+                       if (ref($errhandler) eq 'CODE') {
+                               $errhandler->($csr->err);
+                       }
                        return 0;
                }
                else {
@@ -223,7 +225,7 @@ sub auth ($$) {
        }
        elsif (defined $q->param('openid_identifier')) {
                # myopenid.com affiliate support
-               validate($q, $session, $q->param('openid_identifier'));
+               validate($q, $session, scalar $q->param('openid_identifier'));
        }
 }
 
@@ -238,10 +240,10 @@ sub getobj ($$) {
        my $ua;
        eval q{use LWPx::ParanoidAgent};
        if (! $@) {
-               $ua=LWPx::ParanoidAgent->new;
+               $ua=LWPx::ParanoidAgent->new(agent => $config{useragent});
        }
        else {
-               $ua=LWP::UserAgent->new;
+               $ua=useragent();
        }
 
        # Store the secret in the session.