$OldString) { $Key = $OldLine + $LineOffset; if($Key<0) { $Key = 0; } $Found = -1; while($Key
'; $LineOffset = $LineOffset - 1; } elseif ($Found ==$OldLine+$LineOffset) { $Result[] = '↕ '.$OldString.'
'; } elseif ($Found != $OldLine+$LineOffset) { if ($Found < $OldLine+$LineOffset) { $Result[] = '⇤ '.$OldString.'
'; } else { $Result[] = '← '.$OldString.'
'; $Key = $OldLine + $LineOffset; while ($Key<$Found) { $Result[] = '→ '.$LineArrayNew[$Key].'
'; $Key++; } $Result[] = '→ '.$OldString.'
'; } $LineOffset = $Found-$OldLine; } } if(count($LineArrayNew)>count($LineArrayOld) + $LineOffset) { $Key = count($LineArrayOld) + $LineOffset; while($Key
'; $Key++; } } return $Result; } function get_body($ID, $Rev) { global $DB, $Revision, $Body; if($Rev == $Revision) { $Str = $Body; } else { $DB->query("SELECT Body FROM wiki_revisions WHERE ID='$ID' AND Revision='$Rev'"); if(!$DB->record_count()) { error(404); } list($Str) = $DB->next_record(); } return $Str; } if ( !isset($_GET['old']) || !isset($_GET['new']) || !isset($_GET['id']) || !is_number($_GET['old']) || !is_number($_GET['new']) || !is_number($_GET['id']) || $_GET['old'] > $_GET['new'] ) { error(0); } $ArticleID = $_GET['id']; $Article = $Alias->article($ArticleID); list($Revision, $Title, $Body, $Read, $Edit, $Date, $AuthorID, $AuthorName) = array_shift($Article); if($Read > $LoggedUser['EffectiveClass']){ error(404); } show_header('Compare Article Revisions'); $Diff2 = get_body($ArticleID, $_GET['new']); $Diff1 = get_body($ArticleID, $_GET['old']); ?>

Compare Revisions