Ticket #58357: 58357.diff
File 58357.diff, 1.1 KB (added by , 21 months ago) |
---|
-
wp-includes/formatting.php
754 754 // Find all elements. 755 755 $textarr = wp_html_split( $haystack ); 756 756 $changed = false; 757 $c = count( $textarr ); 757 758 758 759 // Optimize when searching for one item. 759 760 if ( 1 === count( $replace_pairs ) ) { … … 762 763 } 763 764 764 765 // Loop through delimiters (elements) only. 765 for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {766 for ( $i = 1, $c; $i < $c; $i += 2 ) { 766 767 if ( false !== strpos( $textarr[ $i ], $needle ) ) { 767 768 $textarr[ $i ] = str_replace( $needle, $replace, $textarr[ $i ] ); 768 769 $changed = true; … … 773 774 $needles = array_keys( $replace_pairs ); 774 775 775 776 // Loop through delimiters (elements) only. 776 for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {777 for ( $i = 1, $c; $i < $c; $i += 2 ) { 777 778 foreach ( $needles as $needle ) { 778 779 if ( false !== strpos( $textarr[ $i ], $needle ) ) { 779 780 $textarr[ $i ] = strtr( $textarr[ $i ], $replace_pairs );