Ticket #7691: normalize-whitespace-r8812.patch
| File normalize-whitespace-r8812.patch, 2.3 KB (added by , 18 years ago) |
|---|
-
wp-includes/formatting.php
2131 2131 return '<' . $tag . $link . ' target="' . $target . '">'; 2132 2132 } 2133 2133 2134 // normalize EOL characters and strip duplicate whitespace 2135 function normalize_whitespace( $str ) { 2136 $str = trim($str); 2137 $str = str_replace("\r", "\n", $str); 2138 $str = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $str ); 2139 return $str; 2140 } 2141 2134 2142 ?> -
wp-includes/pluggable.php
1644 1644 if ( !class_exists( 'WP_Text_Diff_Renderer_Table' ) ) 1645 1645 require( ABSPATH . WPINC . '/wp-diff.php' ); 1646 1646 1647 // Normalize whitespace 1648 $left_string = trim($left_string); 1649 $right_string = trim($right_string); 1650 $left_string = str_replace("\r", "\n", $left_string); 1651 $right_string = str_replace("\r", "\n", $right_string); 1652 $left_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $left_string ); 1653 $right_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $right_string ); 1647 $left_string = normalize_whitespace($left_string); 1648 $right_string = normalize_whitespace($right_string); 1654 1649 1655 1650 $left_lines = split("\n", $left_string); 1656 1651 $right_lines = split("\n", $right_string); -
wp-admin/edit-form-advanced.php
45 45 // Detect if there exists an autosave newer than the post and if that autosave is different than the post 46 46 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) { 47 47 foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { 48 if ( wp_text_diff( $autosave->$autosave_field,$post->$autosave_field ) ) {48 if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { 49 49 $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); 50 50 break; 51 51 }