Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge PHLAK:hotfix/gravatar-trim-strtolower into master
Browse files Browse the repository at this point in the history
Pull request zendframework/zendframework#4976

Merge commit 'refs/pull/4976/head' of github.com:zendframework/zf2
  • Loading branch information
EvanDotPro committed Aug 18, 2013
2 parents 76c4d1c + bdd7659 commit e1a1ab3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Helper/Gravatar.php
Expand Up @@ -239,7 +239,7 @@ public function getDefaultImg()
public function setEmail($email)
{
$this->emailIsHashed = (bool) preg_match('/^[A-Za-z0-9]{32}$/', $email);
$this->email = $email;
$this->email = strtolower(trim($email));
return $this;
}

Expand Down
7 changes: 7 additions & 0 deletions test/Helper/GravatarTest.php
Expand Up @@ -274,4 +274,11 @@ public function testInvalidKeyPassedToSetOptionsMethod()
);
$this->helper->__invoke()->setOptions($options);
}

public function testEmailIsProperlyNormalized()
{
$this->assertEquals('example@example.com',
$this->helper->__invoke('Example@Example.com ')->getEmail()
);
}
}

0 comments on commit e1a1ab3

Please sign in to comment.