From fcbb43e6fedd5347d36d72b979a6ec76d1a3d87e Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Mon, 5 Jan 2009 00:30:21 +0000 Subject: [PATCH] (DelayRequired): Fix an off-by one error. --- wiki.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wiki.pl b/wiki.pl index b1f44610..390c27f7 100755 --- a/wiki.pl +++ b/wiki.pl @@ -1,5 +1,5 @@ #! /usr/bin/perl -# Version $Id: wiki.pl,v 1.892 2008/12/08 01:10:03 as Exp $ +# Version $Id: wiki.pl,v 1.893 2009/01/05 00:30:21 as Exp $ # Copyleft 2008 Brian Curry # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Alex Schroeder @@ -35,7 +35,7 @@ use CGI::Carp qw(fatalsToBrowser); use vars qw($VERSION); local $| = 1; # Do not buffer output (localized for mod_perl) -$VERSION=(split(/ +/, q{$Revision: 1.892 $}))[1]; # for MakeMaker +$VERSION=(split(/ +/, q{$Revision: 1.893 $}))[1]; # for MakeMaker # Options: use vars qw($RssLicense $RssCacheHours @RcDays $TempDir $LockDir $DataDir @@ -293,7 +293,7 @@ sub InitRequest { sub InitVariables { # Init global session variables for mod_perl! $WikiDescription = $q->p($q->a({-href=>'http://www.oddmuse.org/'}, 'Oddmuse'), $Counter++ > 0 ? Ts('%s calls', $Counter) : '') - . $q->p(q{$Id: wiki.pl,v 1.892 2008/12/08 01:10:03 as Exp $}); + . $q->p(q{$Id: wiki.pl,v 1.893 2009/01/05 00:30:21 as Exp $}); $WikiDescription .= $ModulesDescription if $ModulesDescription; $PrintedHeader = 0; # Error messages don't print headers unless necessary $ReplaceForm = 0; # Only admins may search and replace @@ -3931,7 +3931,7 @@ sub DoSurgeProtection { sub DelayRequired { my $name = shift; my @entries = @{$RecentVisitors{$name}}; - my $ts = $entries[$SurgeProtectionViews - 1]; + my $ts = $entries[$SurgeProtectionViews]; return ($Now - $ts) < $SurgeProtectionTime; }