From 2ca9d91c1c4b1048c7be938a1436def5521a1909 Mon Sep 17 00:00:00 2001 From: Ben Coburn Date: Tue, 31 Oct 2006 23:41:58 +0100 Subject: $REV checking now works correctly with synced attic darcs-hash:20061031224158-05dcb-0bf9505f51be5ab91f258254adfdded5f7087dcf.gz --- inc/common.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/inc/common.php b/inc/common.php index 797ff0525..af1d2248b 100644 --- a/inc/common.php +++ b/inc/common.php @@ -89,15 +89,16 @@ function pageinfo(){ $info['namespace'] = getNS($ID); $info['locked'] = checklock($ID); - $info['filepath'] = realpath(wikiFN($ID,$REV)); + $info['filepath'] = realpath(wikiFN($ID)); $info['exists'] = @file_exists($info['filepath']); - if($REV && !$info['exists']){ + if($REV){ //check if current revision was meant - $cur = wikiFN($ID); - if(@file_exists($cur) && (@filemtime($cur) == $REV)){ - $info['filepath'] = realpath($cur); - $info['exists'] = true; + if($info['exists'] && (@filemtime($info['filepath'])==$REV)){ $REV = ''; + }else{ + //really use old revision + $info['filepath'] = realpath(wikiFN($ID,$REV)); + $info['exists'] = @file_exists($info['filepath']); } } $info['rev'] = $REV; -- cgit v1.2.3