Make WordPress Core


Ignore:
Timestamp:
01/22/2013 03:46:16 PM (13 years ago)
Author:
ryan
Message:

Explicitly set last_changed to 1 instead of the result of wp_cache_set(). Avoids ambiguity and works with cache backends that return void instead of boolean.

see #23167

File:
1 edited

Legend:

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

    r23265 r23319  
    251251        $key = md5( serialize( compact(array_keys($defaults)) )  );
    252252        $last_changed = wp_cache_get( 'last_changed', 'comment' );
    253         if ( ! $last_changed )
    254             $last_changed = wp_cache_set( 'last_changed', 1, 'comment' );
     253        if ( ! $last_changed ) {
     254            wp_cache_set( 'last_changed', 1, 'comment' );
     255            $last_changed = 1;
     256        }
    255257        $cache_key = "get_comments:$key:$last_changed";
    256258
Note: See TracChangeset for help on using the changeset viewer.