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.
This commit is contained in:
		
							parent
							
								
									3ec320a350
								
							
						
					
					
						commit
						23aa9b9807
					
				
				
				Notes:
				
					svn2git
				
				2020-12-08 03:00:23 +00:00 
				
			
			svn path=/www/; revision=26269
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -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"}; | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue