Merge pull request #249 from Dennisprins93/master

This commit is contained in:
Daniel Hensby 2018-05-11 14:02:00 +01:00
commit aa46291adf
No known key found for this signature in database
GPG Key ID: D8DEBC4C8E7BC8B9
2 changed files with 7 additions and 3 deletions

View File

@ -732,11 +732,15 @@ class Comment extends DataObject
$use_gravatar = $this->getOption('use_gravatar'); $use_gravatar = $this->getOption('use_gravatar');
if ($use_gravatar) { if ($use_gravatar) {
$gravatar = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($this->Email))); $gravatar = 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($this->Email)));
$gravatarsize = $this->getOption('gravatar_size'); $gravatarsize = $this->getOption('gravatar_size');
$gravatardefault = $this->getOption('gravatar_default'); $gravatardefault = $this->getOption('gravatar_default');
$gravatarrating = $this->getOption('gravatar_rating'); $gravatarrating = $this->getOption('gravatar_rating');
$gravatar .= '?s=' . $gravatarsize . '&d=' . $gravatardefault . '&r=' . $gravatarrating; $gravatar .= '?' . http_build_query(array(
's' => $gravatarsize,
'd' => $gravatardefault,
'r' => $gravatarrating,
));
} }
return $gravatar; return $gravatar;

View File

@ -992,7 +992,7 @@ class CommentsTest extends FunctionalTest
$comment = $this->objFromFixture(Comment::class, 'firstComA'); $comment = $this->objFromFixture(Comment::class, 'firstComA');
$this->assertEquals( $this->assertEquals(
'http://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s' 'https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s'
. '=80&d=identicon&r=g', . '=80&d=identicon&r=g',
$comment->Gravatar() $comment->Gravatar()
); );