Make WordPress Core


Ignore:
Timestamp:
02/07/2014 08:13:37 AM (11 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r27057 r27115  
    281281        $last_changed = wp_cache_get( 'last_changed', 'comment' );
    282282        if ( ! $last_changed ) {
    283             $last_changed = microtime();
     283            $last_changed = microtime( true );
    284284            wp_cache_set( 'last_changed', $last_changed, 'comment' );
    285285        }
     
    15611561    do_action( 'wp_insert_comment', $id, $comment );
    15621562
    1563     wp_cache_set( 'last_changed', microtime(), 'comment' );
     1563    wp_cache_set( 'last_changed', microtime( true ), 'comment' );
    15641564
    15651565    return $id;
     
    23612361        wp_cache_delete($id, 'comment');
    23622362
    2363     wp_cache_set( 'last_changed', microtime(), 'comment' );
     2363    wp_cache_set( 'last_changed', microtime( true ), 'comment' );
    23642364}
    23652365
Note: See TracChangeset for help on using the changeset viewer.