From 8d1be5ef4fcf1f7b3f69a780e28a9bfcf96979e4 Mon Sep 17 00:00:00 2001 From: "spider@dav" Date: Thu, 15 May 2025 16:21:30 -0400 Subject: diff engine basics fixed for PHP8 --- includes/diff.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/diff.php b/includes/diff.php index 4054249..1e4389c 100644 --- a/includes/diff.php +++ b/includes/diff.php @@ -41,8 +41,8 @@ class _WikiDiffEngine { public $edits = array(); // List of editing operation to convert XV to YV. public $xv = array(), $yv = array(); - public $xchanged, $ychanged; - function _WikiDiffEngine ($from_lines, $to_lines) + public $xchanged = array(), $ychanged = array(); + function __construct ($from_lines, $to_lines) { $n_from = sizeof($from_lines); $n_to = sizeof($to_lines); @@ -447,7 +447,7 @@ class WikiDiff /** * Compute diff between files (or deserialize serialized WikiDiff.) */ - function WikiDiff($from_lines = false, $to_lines = false) + function __construct($from_lines = false, $to_lines = false) { if ($from_lines && $to_lines) { @@ -873,8 +873,7 @@ class WikiDiffFormatter { $html = ''; reset($lines); - while (list ($junk, $line) = each($lines)) - { + foreach( $lines as $junk => $line ) { $html .= "$prefix"; $html .= "" . htmlspecialchars($line) . "\n"; } -- cgit v1.3