WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/08/2011 05:17:17 PM (8 years ago)
Author:
ryan
Message:

Don't send page slugs through prepare() to avoid breaking octets in i18n page slugs. Props SergeyBiryukov. see #10249 #166687

File:
1 edited

Legend:

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

    r18639 r18652  
    31573157
    31583158    $in_string = "'". implode( "','", $parts ) . "'";
    3159     $pages = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name IN ({$in_string}) AND (post_type = %s OR post_type = 'attachment')", $post_type ), OBJECT_K );
     3159    $post_type_sql = $post_type;
     3160    $wpdb->escape_by_ref( $post_type_sql );
     3161    $pages = $wpdb->get_results( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name IN ($in_string) AND (post_type = '$post_type_sql' OR post_type = 'attachment')", OBJECT_K );
    31603162
    31613163    $revparts = array_reverse( $parts );
Note: See TracChangeset for help on using the changeset viewer.