WordPress.org

Make WordPress Core

Ticket #15665: 15665.patch

File 15665.patch, 1013 bytes (added by SergeyBiryukov, 6 years ago)
  • wp-includes/post.php

     
    32103210        $in_string = "'". implode( "','", $parts ) . "'";
    32113211        $post_type_sql = $post_type;
    32123212        $wpdb->escape_by_ref( $post_type_sql );
    3213         $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 );
     3213        $pages = $wpdb->get_results( "SELECT ID, post_name, post_parent, post_type FROM $wpdb->posts WHERE post_name IN ($in_string) AND (post_type = '$post_type_sql' OR post_type = 'attachment')", OBJECT_K );
    32143214
    32153215        $revparts = array_reverse( $parts );
    32163216
     
    32293229
    32303230                        if ( $p->post_parent == 0 && $count+1 == count( $revparts ) && $p->post_name == $revparts[ $count ] ) {
    32313231                                $foundid = $page->ID;
    3232                                 break;
     3232                                if ( $page->post_type == $post_type )
     3233                                        break;
    32333234                        }
    32343235                }
    32353236        }