From 1dfc87b4cba658d178bcd9bb802bb818fc5acd8f Mon Sep 17 00:00:00 2001 From: Guy Van den Broeck Date: Thu, 21 Aug 2008 23:27:07 +0000 Subject: [PATCH] Fixing bug in HTML diff when the word '0' is encountered. Thanks siebrand for reporting --- includes/Diff.php | 2 +- includes/HTMLDiff.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/Diff.php b/includes/Diff.php index c1775d05f4..23b2b9ebb3 100644 --- a/includes/Diff.php +++ b/includes/Diff.php @@ -452,7 +452,7 @@ class WikiDiff3 { $snake0 = $bottoml1 + $most_progress[0]; $snake1 = $bottoml2 + $most_progress[1]; $snake2 = 0; - wfDebug('Computing the LCS is too expensive. Using a heuristic.\n'); + wfDebug("Computing the LCS is too expensive. Using a heuristic.\n"); $this->heuristicUsed = true; return 5; /* * HACK: since we didn't really finish the LCS computation diff --git a/includes/HTMLDiff.php b/includes/HTMLDiff.php index ec076b9262..a504ecfbb5 100644 --- a/includes/HTMLDiff.php +++ b/includes/HTMLDiff.php @@ -486,7 +486,7 @@ class DomTreeBuilder { private $currentParent; - private $newWord = ""; + private $newWord = ''; protected $bodyStarted = false; @@ -584,7 +584,7 @@ class DomTreeBuilder { } private function endWord() { - if (!empty($this->newWord)) { + if ($this->newWord !== '') { $node = new TextNode($this->currentParent, $this->newWord); $this->currentParent->children[] = $node; $node->whiteBefore = $this->whiteSpaceBeforeThis; -- 2.20.1