Ticket #19292: 19292-dont-update-slug-sanitize-type-on-update.diff
File 19292-dont-update-slug-sanitize-type-on-update.diff, 1.2 KB (added by , 13 years ago) |
---|
-
wp-includes/post.php
2490 2490 else 2491 2491 $post_name = ''; 2492 2492 } else { 2493 $post_name = sanitize_title($post_name); 2493 // On updates, we need to check to see if it's using an old sanitization context, or the newer Save context 2494 $check_name = sanitize_title(urlencode($post_name), '', 'query'); // sanitize_title_for_query(), but spelt out here for readability 2495 if ( $update && strtolower(urlencode($post_name)) == $check_name ) 2496 $post_name = $check_name; 2497 else // slug has changed or uses newer (default) sanitization 2498 $post_name = sanitize_title($post_name); 2494 2499 } 2495 2500 2496 2501 // If the post date is empty (due to having been new or a draft) and status is not 'draft' or 'pending', set date to now … … 3153 3158 $page_path = str_replace('%20', ' ', $page_path); 3154 3159 $parts = explode( '/', trim( $page_path, '/' ) ); 3155 3160 $parts = array_map( 'esc_sql', $parts ); 3156 $parts = array_map( 'sanitize_title ', $parts );3161 $parts = array_map( 'sanitize_title_for_query', $parts ); 3157 3162 3158 3163 $in_string = "'". implode( "','", $parts ) . "'"; 3159 3164 $post_type_sql = $post_type;