File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1+ Significance: patch
2+ Type: fixed
3+
4+ Footer: Avoid PHP errors when nested in output buffering.
Original file line number Diff line number Diff line change @@ -17,23 +17,23 @@ function wpcom_better_footer_links_buffer( $page ) {
1717 }
1818
1919 // Would like to only see footer content before wp_footer output.
20- $ output = preg_split ( '/ wpcom_wp_footer/i ' , $ page , 2 );
20+ $ output = explode ( 'wpcom_wp_footer ' , $ page , 2 );
2121
2222 // Run "better link" filters.
2323 $ footer = wpcom_better_footer_links ( $ output [0 ] );
2424
2525 $ remaining_content = $ output [1 ] ?? '' ;
2626
2727 // Piece back together again.
28- $ page = implode ( array ( $ footer, 'wpcom_wp_footer ' . $ remaining_content ) ) ;
28+ $ page = $ footer . 'wpcom_wp_footer ' . $ remaining_content ;
2929
3030 // If nothing to join, return empty string.
3131 if ( 'wpcom_wp_footer ' === $ page ) {
3232 return '' ;
3333 }
3434
3535 // Replace any dangling references of glue code.
36- $ page = preg_replace ( '/ wpcom_wp_footer/i ' , '' , $ page );
36+ $ page = str_replace ( 'wpcom_wp_footer ' , '' , $ page );
3737
3838 return $ page ;
3939}
You can’t perform that action at this time.
0 commit comments