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
This commit is contained in:
Scott Taylor 2014-05-16 21:08:15 +00:00
parent cb3341c03d
commit 54bc77cb93
1 changed files with 1 additions and 1 deletions

View File

@ -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();