From db32378d2371035fcaae1e9aa9ffef7bbd23fef1 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Mon, 12 Apr 2004 01:41:08 +0000 Subject: [PATCH] (GetTextAtTime): Fix bug for rollback action where only the pages were rolled back that were changed at the exact moment! --- wiki.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wiki.pl b/wiki.pl index 1c4bdeb1..b94532c4 100755 --- a/wiki.pl +++ b/wiki.pl @@ -314,7 +314,7 @@ sub InitVariables { # Init global session variables for mod_perl! } } $WikiDescription = $q->p($q->a({-href=>'http://www.oddmuse.org/'}, 'Oddmuse')) - . $q->p('$Id: wiki.pl,v 1.378 2004/04/12 01:16:01 as Exp $'); + . $q->p('$Id: wiki.pl,v 1.379 2004/04/12 01:41:08 as Exp $'); $WikiDescription .= $ModulesDescription if $ModulesDescription; } @@ -2361,15 +2361,18 @@ sub OpenPage { # Sets global variables sub GetTextAtTime { my $ts = shift; my @keeps = GetKeepFiles($OpenPageName); + my ($maxts, $result); foreach my $keep (@keeps) { my ($status, $data) = ReadFile($keep); next unless $status; my %field = ParseData($data); if ($field{ts} == $ts) { return $field{text}; + } elsif ($field{ts} <= $ts and $field{ts} > $maxts) { + $result = $field{text}; } } - return ''; + return $result; } sub GetTextRevision {