From 8d4e05bedef4b77b10d75a8b2534dad99f234ba9 Mon Sep 17 00:00:00 2001 From: modela bitweaver Date: Mon, 1 Feb 2021 22:44:01 -0500 Subject: index check in wiki diff --- includes/diff.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/diff.php b/includes/diff.php index 8b57d32..bcda57f 100644 --- a/includes/diff.php +++ b/includes/diff.php @@ -190,8 +190,11 @@ class _WikiDiffEngine $x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks); for ( ; $x < $x1; $x++) { - $matches = $ymatches[$flip ? $this->yv[$x] : $this->xv[$x]]; - if (!$matches) + $index = ($flip ? $this->yv[$x] : $this->xv[$x]); + if( !empty( $ymatches[$index] ) ) { + $matches = $ymatches[$index]; + } + if (empty($matches)) continue; reset($matches); while (list ($junk, $y) = each($matches)) -- cgit v1.3