Merge "UploadStash us_props fix for Postgres"
[lhc/web/wiklou.git] / includes / diff / DairikiDiff.php
index c27ed1f..c47eced 100644 (file)
@@ -384,6 +384,8 @@ class DiffEngine {
                                if ( empty( $ymatches[$line] ) ) {
                                        continue;
                                }
+
+                               $k = 0;
                                $matches = $ymatches[$line];
                                reset( $matches );
                                while ( list( , $y ) = each( $matches ) ) {
@@ -394,6 +396,7 @@ class DiffEngine {
                                                break;
                                        }
                                }
+
                                while ( list( , $y ) = each( $matches ) ) {
                                        if ( $y > $this->seq[$k - 1] ) {
                                                assert( '$y < $this->seq[$k]' );
@@ -833,6 +836,9 @@ class MappedDiff extends Diff {
  * @ingroup DifferenceEngine
  */
 class HWLDFWordAccumulator {
+       public $insClass = ' class="diffchange diffchange-inline"';
+       public $delClass = ' class="diffchange diffchange-inline"';
+
        private $lines = array();
        private $line = '';
        private $group = '';
@@ -844,10 +850,10 @@ class HWLDFWordAccumulator {
        private function flushGroup( $new_tag ) {
                if ( $this->group !== '' ) {
                        if ( $this->tag == 'ins' ) {
-                               $this->line .= '<ins class="diffchange diffchange-inline">' .
+                               $this->line .= "<ins{$this->insClass}>" .
                                        htmlspecialchars( $this->group ) . '</ins>';
                        } elseif ( $this->tag == 'del' ) {
-                               $this->line .= '<del class="diffchange diffchange-inline">' .
+                               $this->line .= "<del{$this->delClass}>" .
                                        htmlspecialchars( $this->group ) . '</del>';
                        } else {
                                $this->line .= htmlspecialchars( $this->group );