X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cgi%2Flibravatar.cgi;h=33aa90a7d5b09c8a3d8296e77dbd93bf336983d0;hb=307a891161c5c60babae0416455c1a3a34cff34b;hp=3b8420d76508181215405395aba013bea5126571;hpb=2da5c58430ad99f69d913865850c002af6882181;p=debbugs.git diff --git a/cgi/libravatar.cgi b/cgi/libravatar.cgi index 3b8420d..33aa90a 100755 --- a/cgi/libravatar.cgi +++ b/cgi/libravatar.cgi @@ -6,7 +6,6 @@ use strict; use Debbugs::Config qw(:config); use Debbugs::CGI qw(cgi_parameters); use Debbugs::Common; -use Digest::MD5 qw(md5_hex); use File::LibMagic; use Debbugs::Libravatar qw(:libravatar); @@ -30,11 +29,9 @@ if ($param{avatar} ne 'yes' or not defined $param{email} or not length $param{em exit 0; } -# figure out what the md5sum of the e-mail is. -my $email_md5sum = md5_hex(lc($param{email})); -my $cache_location = cache_location(email => lc($param{email})); +my ($cache_location, $is_valid) = cache_location(email => lc($param{email})); # if we've got it, and it's less than one hour old, return it. -if (cache_valid($cache_location)) { +if ($is_valid) { serve_cache($cache_location,$q); exit 0; }