Use a float for last_changed microtime cache values.
microtime() by default returns a string with a space, which isn't allowed for keys in some cache backends. props _jameslee, drozdz. fixes #27000. see #23448. Built from https://develop.svn.wordpress.org/trunk@27115 git-svn-id: http://core.svn.wordpress.org/trunk@26982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -280,7 +280,7 @@ class WP_Comment_Query {
|
||||
$key = md5( serialize( compact(array_keys($defaults)) ) );
|
||||
$last_changed = wp_cache_get( 'last_changed', 'comment' );
|
||||
if ( ! $last_changed ) {
|
||||
$last_changed = microtime();
|
||||
$last_changed = microtime( true );
|
||||
wp_cache_set( 'last_changed', $last_changed, 'comment' );
|
||||
}
|
||||
$cache_key = "get_comments:$key:$last_changed";
|
||||
@@ -1560,7 +1560,7 @@ function wp_insert_comment($commentdata) {
|
||||
*/
|
||||
do_action( 'wp_insert_comment', $id, $comment );
|
||||
|
||||
wp_cache_set( 'last_changed', microtime(), 'comment' );
|
||||
wp_cache_set( 'last_changed', microtime( true ), 'comment' );
|
||||
|
||||
return $id;
|
||||
}
|
||||
@@ -2360,7 +2360,7 @@ function clean_comment_cache($ids) {
|
||||
foreach ( (array) $ids as $id )
|
||||
wp_cache_delete($id, 'comment');
|
||||
|
||||
wp_cache_set( 'last_changed', microtime(), 'comment' );
|
||||
wp_cache_set( 'last_changed', microtime( true ), 'comment' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user