forked from github/kensanata.oddmuse
(GetTextAtTime): Another bugfix for rollback action.
This commit is contained in:
8
wiki.pl
8
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.380 2004/04/12 01:55:32 as Exp $');
|
||||
. $q->p('$Id: wiki.pl,v 1.381 2004/04/12 02:30:24 as Exp $');
|
||||
$WikiDescription .= $ModulesDescription if $ModulesDescription;
|
||||
}
|
||||
|
||||
@@ -2360,8 +2360,10 @@ sub OpenPage { # Sets global variables
|
||||
|
||||
sub GetTextAtTime {
|
||||
my $ts = shift;
|
||||
return $DeletedPage if $Page{revision} == 1 and $Page{ts} > $ts; # page is too new!
|
||||
return $Page{text} if $Page{revision} == 1; # there is no older version!
|
||||
my @keeps = GetKeepFiles($OpenPageName);
|
||||
my ($maxts, $result);
|
||||
my ($maxts, $result, $newpage);
|
||||
foreach my $keep (@keeps) {
|
||||
my ($status, $data) = ReadFile($keep);
|
||||
next unless $status;
|
||||
@@ -2371,6 +2373,8 @@ sub GetTextAtTime {
|
||||
} elsif ($field{ts} < $ts and $field{ts} > $maxts) {
|
||||
$result = $field{text};
|
||||
$maxts = $field{ts};
|
||||
} elsif ($field{ts} > $ts and $field{revision} == 1) {
|
||||
return $DeletedPage; # then the page was created after $ts!
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user