From 9c2d3a7a4d1b27509e9ec80cf4c5a1f55d77348e Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 23 Dec 2015 20:14:12 +0000 Subject: [PATCH] Improve post-filter sanitization of excluded terms in `get_adjacent_post()`. See [36078], #35211. git-svn-id: https://develop.svn.wordpress.org/trunk@36079 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 5d88bd60c3..ca6ccfcf88 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -1614,7 +1614,7 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms ); if ( ! empty( $excluded_terms ) ) { - $where .= " AND p.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships tr LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.term_id IN (" . implode( $excluded_terms, ',' ) . ') )'; + $where .= " AND p.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships tr LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.term_id IN (" . implode( ',', array_map( 'intval', $excluded_terms ) ) . ') )'; } }