Merge "Remove unused ApiStashEdit variable"
[lhc/web/wiklou.git] / includes / diff / TableDiffFormatter.php
index 83e04a5..be38e87 100644 (file)
@@ -62,8 +62,14 @@ class TableDiffFormatter extends DiffFormatter {
        protected function blockHeader( $xbeg, $xlen, $ybeg, $ylen ) {
                // '<!--LINE \d+ -->' get replaced by a localised line number
                // in DifferenceEngine::localiseLineNumbers
-               $r = '<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l' . $xbeg . '" ><!--LINE ' . $xbeg . "--></td>\n" .
-                       '<td colspan="2" class="diff-lineno"><!--LINE ' . $ybeg . "--></td></tr>\n";
+               $r = '<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l' .
+                       $xbeg .
+                       '" ><!--LINE ' .
+                       $xbeg .
+                       "--></td>\n" .
+                       '<td colspan="2" class="diff-lineno"><!--LINE ' .
+                       $ybeg .
+                       "--></td></tr>\n";
 
                return $r;
        }
@@ -198,10 +204,12 @@ class TableDiffFormatter extends DiffFormatter {
                # Notice that WordLevelDiff returns HTML-escaped output.
                # Hence, we will be calling addedLine/deletedLine without HTML-escaping.
 
-               while ( $line = array_shift( $del ) ) {
+               $line = array_shift( $del );
+               while ( $line ) {
                        $aline = array_shift( $add );
                        echo '<tr>' . $this->deletedLine( $line ) .
                                $this->addedLine( $aline ) . "</tr>\n";
+                       $line = array_shift( $del );
                }
                foreach ( $add as $line ) { # If any leftovers
                        echo '<tr>' . $this->emptyLine() .