Changeset 9302
- Timestamp:
- 10/23/2008 08:03:16 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r9291 r9302 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; -
trunk/wp-includes/formatting.php
r9255 r9302 2145 2145 } 2146 2146 2147 // normalize EOL characters and strip duplicate whitespace 2148 function normalize_whitespace( $str ) { 2149 $str = trim($str); 2150 $str = str_replace("\r", "\n", $str); 2151 $str = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $str ); 2152 return $str; 2153 } 2154 2147 2155 ?> -
trunk/wp-includes/pluggable.php
r9243 r9302 1664 1664 require( ABSPATH . WPINC . '/wp-diff.php' ); 1665 1665 1666 // Normalize whitespace 1667 $left_string = trim($left_string); 1668 $right_string = trim($right_string); 1669 $left_string = str_replace("\r", "\n", $left_string); 1670 $right_string = str_replace("\r", "\n", $right_string); 1671 $left_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $left_string ); 1672 $right_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $right_string ); 1666 $left_string = normalize_whitespace($left_string); 1667 $right_string = normalize_whitespace($right_string); 1673 1668 1674 1669 $left_lines = split("\n", $left_string);
Note: See TracChangeset
for help on using the changeset viewer.