Skip to content

Commit

Permalink
have most current revision always available in $INFO
Browse files Browse the repository at this point in the history
fixes fix for FS#2853
  • Loading branch information
splitbrain committed Feb 23, 2014
1 parent adfe6da commit 01c9a11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions inc/common.php
Expand Up @@ -155,12 +155,13 @@ function pageinfo() {
$info['subscribed'] = false;
}

$info['locked'] = checklock($ID);
$info['filepath'] = fullpath(wikiFN($ID));
$info['exists'] = @file_exists($info['filepath']);
$info['locked'] = checklock($ID);
$info['filepath'] = fullpath(wikiFN($ID));
$info['exists'] = @file_exists($info['filepath']);
$info['currentrev'] = @filemtime($info['filepath']);
if($REV) {
//check if current revision was meant
if($info['exists'] && (@filemtime($info['filepath']) == $REV)) {
if($info['exists'] && ($info['currentrev'] == $REV)) {
$REV = '';
} elseif($RANGE) {
//section editing does not work with old revisions!
Expand Down
2 changes: 1 addition & 1 deletion inc/html.php
Expand Up @@ -1189,7 +1189,7 @@ function html_diff($text='',$intro=true,$type=null){
$diffurl = wl($ID, array(
'do' => 'diff',
'rev2[0]' => $l_rev,
'rev2[1]' => $r_rev ? $r_rev : $INFO['lastmod'], // link to exactly this view FS#2835
'rev2[1]' => $r_rev ? $r_rev : $INFO['currentrev'], // link to exactly this view FS#2835
'difftype' => $type,
));
ptln('<p><a class="wikilink1" href="'.$diffurl.'">'.$lang['difflink'].'</a></p>');
Expand Down

0 comments on commit 01c9a11

Please sign in to comment.