diff options
Diffstat (limited to 'inc/html.php')
-rw-r--r-- | inc/html.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/inc/html.php b/inc/html.php index 06060e2db..9df9aae72 100644 --- a/inc/html.php +++ b/inc/html.php @@ -633,10 +633,18 @@ function html_diff($text='',$intro=true){ $lang['current']; $right = $lang['yours']; }else{ - $df = new Diff(split("\n",htmlspecialchars(rawWiki($ID,$REV))), + if($REV){ + $r = $REV; + }else{ + //use last revision if none given + $revs = getRevisions($ID); + $r = $revs[0]; + } + + $df = new Diff(split("\n",htmlspecialchars(rawWiki($ID,$r))), split("\n",htmlspecialchars(rawWiki($ID,'')))); - $left = '<a class="wikilink1" href="'.wl($ID,"rev=$REV").'">'. - $ID.' '.date($conf['dformat'],$REV).'</a>'; + $left = '<a class="wikilink1" href="'.wl($ID,"rev=$r").'">'. + $ID.' '.date($conf['dformat'],$r).'</a>'; $right = '<a class="wikilink1" href="'.wl($ID).'">'. $ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).'</a> '. $lang['current']; |