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 perhapsmaster
parent
c8cf2d1ed7
commit
f4262696ad
|
@ -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});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue