WordPress.org

Make WordPress Core

Ticket #8085: query.patch

File query.patch, 449 bytes (added by stefano.verna, 13 years ago)

The Patch

Line 
1Index: wp-includes/query.php
2===================================================================
3--- wp-includes/query.php       (revision 9553)
4+++ wp-includes/query.php       (working copy)
5@@ -970,7 +970,7 @@
6                        $where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)";
7                }
8
9-               if ( $q['post_parent'] )
10+               if ( is_integer($q['post_parent']) )
11                        $where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] );
12
13                if ( $q['page_id'] ) {