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.


Built from https://develop.svn.wordpress.org/trunk@28460


git-svn-id: http://core.svn.wordpress.org/trunk@28287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-16 21:09:14 +00:00
parent 0aafc8f874
commit a39aecc9b1

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