Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #1208 from CPAN-API/tsibley/more-gravatar-munging
Browse files Browse the repository at this point in the history
Munge more Gravatar urls into https submission
  • Loading branch information
oalders committed May 27, 2014
2 parents 0edd081 + 964250a commit 328e6d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/MetaCPAN/Web/View/HTML.pm
Expand Up @@ -179,7 +179,10 @@ Template::Alloy->define_vmethod(
'text',
gravatar_fixup => sub {
my ( $url, $size ) = @_;
if ( $url =~ m{^https?://(secure|www)\.gravatar\.com/avatar/} ) {
if ( $url
=~ m{^https?://([a-z0-9.-]+\.)?gravatar\.com/(avatar|userimage)/}i
)
{
my $url = URI->new($url);
$url->scheme('https');
$url->host('secure.gravatar.com');
Expand Down
5 changes: 3 additions & 2 deletions root/static/js/contributors.js
Expand Up @@ -13,8 +13,9 @@ $(function(){
// TODO make this an :before pseudo-class
var gravatar = data.gravatar_url;
gravatar = gravatar.replace(
"^http://(www\.)?gravatar.com/",
"https://secure.gravatar.com/"
"^https?://([a-z0-9.-]+\.)?gravatar\.com/",
"https://secure.gravatar.com/",
"i"
).replace(
/s=\d+/,
's=20'
Expand Down

0 comments on commit 328e6d4

Please sign in to comment.