summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorspider@dav <spiderr@bitweaver.org>2025-05-15 16:21:30 -0400
committerspider@dav <spiderr@bitweaver.org>2025-05-15 16:21:30 -0400
commit8d1be5ef4fcf1f7b3f69a780e28a9bfcf96979e4 (patch)
tree30ad8b52f0f47ebefd719b9e23822d24976da363 /includes
parented0c507cafa4eaee97a9931b21e2fbfe8a0180a9 (diff)
downloadutil-8d1be5ef4fcf1f7b3f69a780e28a9bfcf96979e4.tar.gz
util-8d1be5ef4fcf1f7b3f69a780e28a9bfcf96979e4.tar.bz2
util-8d1be5ef4fcf1f7b3f69a780e28a9bfcf96979e4.zip
diff engine basics fixed for PHP8
Diffstat (limited to 'includes')
-rw-r--r--includes/diff.php9
1 files 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 .= "<tr style=\"background-color: $color\"><td><tt>$prefix</tt>";
$html .= "<tt>" . htmlspecialchars($line) . "</tt></td></tr>\n";
}