Fixing bug in HTML diff when the word '0' is encountered. Thanks siebrand for reporting
authorGuy Van den Broeck <guyvdb@users.mediawiki.org>
Thu, 21 Aug 2008 23:27:07 +0000 (23:27 +0000)
committerGuy Van den Broeck <guyvdb@users.mediawiki.org>
Thu, 21 Aug 2008 23:27:07 +0000 (23:27 +0000)
includes/Diff.php
includes/HTMLDiff.php

index c1775d0..23b2b9e 100644 (file)
@@ -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
index ec076b9..a504ecf 100644 (file)
@@ -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;