wp/wp-includes/class-wp-text-diff-renderer-table.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
--- a/wp/wp-includes/class-wp-text-diff-renderer-table.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/class-wp-text-diff-renderer-table.php	Wed Sep 21 18:19:35 2022 +0200
@@ -176,7 +176,7 @@
 			}
 
 			if ( $this->_show_split_view ) {
-				$r .= '<tr>' . $this->emptyLine() . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n";
+				$r .= '<tr>' . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n";
 			} else {
 				$r .= '<tr>' . $this->addedLine( $line ) . "</tr>\n";
 			}
@@ -201,7 +201,7 @@
 				$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'deleted' );
 			}
 			if ( $this->_show_split_view ) {
-				$r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . $this->emptyLine() . "</tr>\n";
+				$r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . "</tr>\n";
 			} else {
 				$r .= '<tr>' . $this->deletedLine( $line ) . "</tr>\n";
 			}
@@ -226,7 +226,7 @@
 				$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'unchanged' );
 			}
 			if ( $this->_show_split_view ) {
-				$r .= '<tr>' . $this->contextLine( $line ) . $this->emptyLine() . $this->contextLine( $line ) . "</tr>\n";
+				$r .= '<tr>' . $this->contextLine( $line ) . $this->contextLine( $line ) . "</tr>\n";
 			} else {
 				$r .= '<tr>' . $this->contextLine( $line ) . "</tr>\n";
 			}
@@ -274,7 +274,7 @@
 				// If they're too different, don't include any <ins> or <del>'s.
 				if ( preg_match_all( '!(<ins>.*?</ins>|<del>.*?</del>)!', $diff, $diff_matches ) ) {
 					// Length of all text between <ins> or <del>.
-					$stripped_matches = strlen( strip_tags( join( ' ', $diff_matches[0] ) ) );
+					$stripped_matches = strlen( strip_tags( implode( ' ', $diff_matches[0] ) ) );
 					// Since we count length of text between <ins> or <del> (instead of picking just one),
 					// we double the length of chars not in those tags.
 					$stripped_diff = strlen( strip_tags( $diff ) ) * 2 - $stripped_matches;
@@ -319,7 +319,7 @@
 				$r .= $this->_deleted( array( $orig_line ), false );
 			} else { // A true changed row.
 				if ( $this->_show_split_view ) {
-					$r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->emptyLine() . $this->addedLine( $final_line ) . "</tr>\n";
+					$r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "</tr>\n";
 				} else {
 					$r .= '<tr>' . $this->deletedLine( $orig_line ) . '</tr><tr>' . $this->addedLine( $final_line ) . "</tr>\n";
 				}