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,16 +189,21 @@ sub preprocess {
|
||||||
$commentauthor = $commentuser;
|
$commentauthor = $commentuser;
|
||||||
}
|
}
|
||||||
|
|
||||||
eval 'use Libravatar::URL';
|
eval q{use Libravatar::URL};
|
||||||
if (! $@) {
|
if (! $@) {
|
||||||
if (defined $commentopenid) {
|
if (defined $commentopenid) {
|
||||||
|
eval {
|
||||||
$commentauthoravatar = libravatar_url(openid => $commentopenid, https => $ENV{HTTPS});
|
$commentauthoravatar = libravatar_url(openid => $commentopenid, https => $ENV{HTTPS});
|
||||||
}
|
}
|
||||||
elsif (my $email = IkiWiki::userinfo_get($commentuser, 'email')) {
|
}
|
||||||
|
if (! defined $commentauthoravatar &&
|
||||||
|
(my $email = IkiWiki::userinfo_get($commentuser, 'email'))) {
|
||||||
|
eval {
|
||||||
$commentauthoravatar = libravatar_url(email => $email, https => $ENV{HTTPS});
|
$commentauthoravatar = libravatar_url(email => $email, https => $ENV{HTTPS});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (defined $params{ip}) {
|
if (defined $params{ip}) {
|
||||||
$commentip = $params{ip};
|
$commentip = $params{ip};
|
||||||
|
|
Loading…
Reference in New Issue