@@ -826,23 +826,33 @@ private function log_bits( $search_regex, $old_data, $old_matches, $new ) {
826
826
$ i = 0 ;
827
827
$ diff = 0 ;
828
828
$ new_matches = array ();
829
- $ new_data = preg_replace_callback ( $ search_regex , function ( $ matches ) use ( $ old_matches , $ new , $ is_regex , &$ new_matches , &$ i , &$ diff ) {
830
- if ( $ is_regex ) {
831
- // Sub in any back references, "$1", "\2" etc, in the replacement string.
832
- $ new = preg_replace_callback ( '/(?<! \\\\)(?: \\\\\\\\)*((?: \\\\| \\$)[0-9]{1,2}| \\${[0-9]{1,2} \\})/ ' , function ( $ m ) use ( $ matches ) {
833
- $ idx = (int ) str_replace ( array ( '\\' , '$ ' , '{ ' , '} ' ), '' , $ m [0 ] );
834
- return isset ( $ matches [ $ idx ] ) ? $ matches [ $ idx ] : '' ;
835
- }, $ new );
836
- $ new = str_replace ( '\\\\' , '\\' , $ new ); // Unescape any backslashed backslashes.
837
- }
838
-
839
- $ new_matches [0 ][ $ i ][0 ] = $ new ;
840
- $ new_matches [0 ][ $ i ][1 ] = $ old_matches [0 ][ $ i ][1 ] + $ diff ;
841
-
842
- $ diff += strlen ( $ new ) - strlen ( $ old_matches [0 ][ $ i ][0 ] );
843
- $ i ++;
844
- return $ new ;
845
- }, $ old_data , $ this ->regex_limit , $ match_cnt );
829
+ $ new_data = preg_replace_callback (
830
+ $ search_regex ,
831
+ function ( $ matches ) use ( $ old_matches , $ new , $ is_regex , &$ new_matches , &$ i , &$ diff ) {
832
+ if ( $ is_regex ) {
833
+ // Sub in any back references, "$1", "\2" etc, in the replacement string.
834
+ $ new = preg_replace_callback (
835
+ '/(?<! \\\\)(?: \\\\\\\\)*((?: \\\\| \\$)[0-9]{1,2}| \\${[0-9]{1,2} \\})/ ' ,
836
+ function ( $ m ) use ( $ matches ) {
837
+ $ idx = (int ) str_replace ( array ( '\\' , '$ ' , '{ ' , '} ' ), '' , $ m [0 ] );
838
+ return isset ( $ matches [ $ idx ] ) ? $ matches [ $ idx ] : '' ;
839
+ },
840
+ $ new
841
+ );
842
+ $ new = str_replace ( '\\\\' , '\\' , $ new ); // Unescape any backslashed backslashes.
843
+ }
844
+
845
+ $ new_matches [0 ][ $ i ][0 ] = $ new ;
846
+ $ new_matches [0 ][ $ i ][1 ] = $ old_matches [0 ][ $ i ][1 ] + $ diff ;
847
+
848
+ $ diff += strlen ( $ new ) - strlen ( $ old_matches [0 ][ $ i ][0 ] );
849
+ $ i ++;
850
+ return $ new ;
851
+ },
852
+ $ old_data ,
853
+ $ this ->regex_limit ,
854
+ $ match_cnt
855
+ );
846
856
847
857
$ old_bits = array ();
848
858
$ new_bits = array ();
0 commit comments