diff --git a/src/Gravatar.php b/src/Gravatar.php index ff86bcc..82a37f2 100644 --- a/src/Gravatar.php +++ b/src/Gravatar.php @@ -16,7 +16,7 @@ class Gravatar extends Base 'wavatar', ]; - private const URL = 'https://www.gravatar.com/avatar/%s.jpg?d=%s&size=%d'; + private const URL = 'https://www.gravatar.com/avatar/%s?d=%s&size=%d'; public static function gravatarUrl(string $mode = null, string $email = null, int $size = 80): string { diff --git a/tests/GravatarTest.php b/tests/GravatarTest.php index 4a95b5b..f9b18c0 100644 --- a/tests/GravatarTest.php +++ b/tests/GravatarTest.php @@ -9,17 +9,17 @@ class GravatarTest extends TestCase { public function testDefaultUrlValues() { - $this->assertRegExp('#^https://www\.gravatar\.com/avatar/\d+\.jpg\?d=retro&size=80#', Gravatar::gravatarUrl()); + $this->assertRegExp('#^https://www\.gravatar\.com/avatar/\d+\?d=retro&size=80#', Gravatar::gravatarUrl()); } public function testGravatarUrlAcceptsCustomMode() { - $this->assertRegExp('#^https://www\.gravatar\.com/avatar/\d+\.jpg\?d=mp&size=80#', Gravatar::gravatarUrl('mp')); + $this->assertRegExp('#^https://www\.gravatar\.com/avatar/\d+\?d=mp&size=80#', Gravatar::gravatarUrl('mp')); } public function testGravatarUrlAcceptsCustomSize() { - $this->assertRegExp('#^https://www\.gravatar\.com/avatar/\d+\.jpg\?d=retro&size=200#', Gravatar::gravatarUrl(null, null, 200)); + $this->assertRegExp('#^https://www\.gravatar\.com/avatar/\d+\?d=retro&size=200#', Gravatar::gravatarUrl(null, null, 200)); } public function testGravatarUrlAcceptsCustomEmail() @@ -27,7 +27,7 @@ public function testGravatarUrlAcceptsCustomEmail() $email = 'TeSt@EmAiL.OK'; $hash = md5(strtolower($email)); - $this->assertRegExp("#^https://www\.gravatar\.com/avatar/${hash}\.jpg\?d=retro&size=80#", Gravatar::gravatarUrl(null, $email)); + $this->assertRegExp("#^https://www\.gravatar\.com/avatar/${hash}\?d=retro&size=80#", Gravatar::gravatarUrl(null, $email)); } public function testDownloadWithDefaults()