From 54bc77cb932dea4742de3e733012a76d40581b0e Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 16 May 2014 21:08:15 +0000 Subject: [PATCH] The cache key for comments in `WP_Comment_Query::query()` needs to do `wp_array_slice_assoc( $this->query_vars, array_keys( $defaults ) )` instead of `compact( array_keys( $defaults ) )`. The latter assumes all of those variables are still floating around. See #22400. git-svn-id: https://develop.svn.wordpress.org/trunk@28460 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 76b1789985..d4302a997c 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -276,7 +276,7 @@ class WP_Comment_Query { do_action_ref_array( 'pre_get_comments', array( &$this ) ); // $args can be whatever, only use the args defined in defaults to compute the key - $key = md5( serialize( compact( array_keys( $defaults ) ) ) ); + $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $defaults ) ) ) ); $last_changed = wp_cache_get( 'last_changed', 'comment' ); if ( ! $last_changed ) { $last_changed = microtime();