$commentauthor = $commentuser;
}
- eval 'use Libravatar::URL';
+ eval q{use Libravatar::URL};
+ if (! $@) {
+ my $https=defined $config{url} && $config{url}=~/^https:/;
- if (! $@) {
- if (defined $commentopenid) {
- $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 $commentopenid) {
+ eval {
+ $commentauthoravatar = libravatar_url(openid => $commentopenid, https => $https);
+ }
+ }
+ if (! defined $commentauthoravatar &&
+ (my $email = IkiWiki::userinfo_get($commentuser, 'email'))) {
+ eval {
+ $commentauthoravatar = libravatar_url(email => $email, https => $https);
+ }
+ }
+ }
}
else {
if (defined $params{ip}) {
my $url=$params{url};
eval q{use URI::Heuristic};
- if (! $@) {
+ if (! $@) {
$url=URI::Heuristic::uf_uristr($url);
}