X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cgi%2Flibravatar.cgi;h=33aa90a7d5b09c8a3d8296e77dbd93bf336983d0;hb=307a891161c5c60babae0416455c1a3a34cff34b;hp=c0ff013013220b4aa104c55696c1e870d93f0daa;hpb=8b39f4838232a72cc22d8a9c4d3911277640e2cd;p=debbugs.git diff --git a/cgi/libravatar.cgi b/cgi/libravatar.cgi index c0ff013..33aa90a 100755 --- a/cgi/libravatar.cgi +++ b/cgi/libravatar.cgi @@ -6,16 +6,11 @@ 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 File::Temp qw(tempfile); use Debbugs::Libravatar qw(:libravatar); use Libravatar::URL; -use LWP::UserAgent; -use HTTP::Request; - use CGI::Simple; use Cwd qw(abs_path); @@ -34,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; }