summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-03-30 10:54:24 -0400
committerJoey Hess <joey@kitenet.net>2011-03-30 10:54:24 -0400
commitf4262696ad9250ca14ba89849270dfeb3518c38d (patch)
tree42b85529f9913f28718258279f1f320b38bc017d /IkiWiki/Plugin
parentc8cf2d1ed791e56d6b3c0191c0a9ba8c8ce59868 (diff)
robustness fix
Don't fail if libravatar fails for some reason. Reasons I can think of: * too old version to do openid lookups (fall back to email lookup) * network problem perhaps
Diffstat (limited to 'IkiWiki/Plugin')
-rwxr-xr-xIkiWiki/Plugin/comments.pm13
1 files changed, 9 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index df20e7b96..fcce6c5a6 100755
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -189,13 +189,18 @@ sub preprocess {
$commentauthor = $commentuser;
}
- eval 'use Libravatar::URL';
+ eval q{use Libravatar::URL};
if (! $@) {
if (defined $commentopenid) {
- $commentauthoravatar = libravatar_url(openid => $commentopenid, https => $ENV{HTTPS});
+ eval {
+ $commentauthoravatar = libravatar_url(openid => $commentopenid, https => $ENV{HTTPS});
+ }
}
- elsif (my $email = IkiWiki::userinfo_get($commentuser, 'email')) {
- $commentauthoravatar = libravatar_url(email => $email, https => $ENV{HTTPS});
+ if (! defined $commentauthoravatar &&
+ (my $email = IkiWiki::userinfo_get($commentuser, 'email'))) {
+ eval {
+ $commentauthoravatar = libravatar_url(email => $email, https => $ENV{HTTPS});
+ }
}
}
}