WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/24/2011 12:20:21 AM (9 years ago)
Author:
dd32
Message:

Switch to sanitize_title_for_query() for Query sanitization (allows for pre-3.3 page slugs to be viewable), Don't update page slugs to new slug-types when the slug is not being changed, Don't issue a XHR if the page slug hasn't changed. Group effort props xknown, markjaquith, nacin. See #19292

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r19305 r19444  
    24912491            $post_name = '';
    24922492    } else {
    2493         $post_name = sanitize_title($post_name);
     2493        // On updates, we need to check to see if it's using the old, fixed sanitization context.
     2494        $check_name = sanitize_title( $post_name, '', 'old-save' );
     2495        if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $ID ) == $check_name )
     2496            $post_name = $check_name;
     2497        else // new post, or slug has changed.
     2498            $post_name = sanitize_title($post_name);
    24942499    }
    24952500
     
    31543159    $parts = explode( '/', trim( $page_path, '/' ) );
    31553160    $parts = array_map( 'esc_sql', $parts );
    3156     $parts = array_map( 'sanitize_title', $parts );
     3161    $parts = array_map( 'sanitize_title_for_query', $parts );
    31573162
    31583163    $in_string = "'". implode( "','", $parts ) . "'";
Note: See TracChangeset for help on using the changeset viewer.