From 23aa9b98075a1c5c7ae999e141fa564bb22b2b50 Mon Sep 17 00:00:00 2001 From: Ceri Davies Date: Sun, 6 Nov 2005 22:07:23 +0000 Subject: [PATCH] Correct a bug regarding the expiration of codes. The test for expired codes was inverted, so emptied the database every time the test ran. Due to the time that the sweep was made, this bug only hit the user if someone else had submitted a PR in the period between their obtaining the code and submitting the PR. This is likely the cause of the unexplained failures that some users were seeing, which we all blamed on misbehaving caches. --- en/cgi/dosendpr.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/cgi/dosendpr.cgi b/en/cgi/dosendpr.cgi index edc5310392..46133583e4 100755 --- a/en/cgi/dosendpr.cgi +++ b/en/cgi/dosendpr.cgi @@ -8,7 +8,7 @@ # GNU General Public License Version 2. # (http://www.gnu.ai.mit.edu/copyleft/gpl.html) # -# $FreeBSD: www/en/cgi/dosendpr.cgi,v 1.21 2004/02/16 16:57:10 ceri Exp $ +# $FreeBSD: www/en/cgi/dosendpr.cgi,v 1.22 2005/07/14 11:26:17 ceri Exp $ require "html.pl"; @@ -129,7 +129,7 @@ delete $db_hash{"$codeentered"}; # Sweep for and remove expired codes. foreach $randomcode (keys %db_hash) { - if ( ($currenttime - $expiretime) <= $db_hash{$randomcode}) { + if ( ($currenttime - $expiretime) >= $db_hash{$randomcode}) { delete $db_hash{"$randomcode"}; } }