WordPress.org

Make WordPress Core

Changeset 23319


Ignore:
Timestamp:
01/22/2013 03:46:16 PM (7 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

Location:
trunk/wp-includes
Files:
2 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
  • trunk/wp-includes/post.php

    r23311 r23319  
    36533653    $key = md5( serialize( compact(array_keys($defaults)) ) );
    36543654    $last_changed = wp_cache_get( 'last_changed', 'posts' );
    3655     if ( ! $last_changed )
    3656         $last_changed = wp_cache_set( 'last_changed', 1, 'posts' );
     3655    if ( ! $last_changed ) {
     3656        wp_cache_set( 'last_changed', 1, 'posts' );
     3657        $last_changed = 1;
     3658    }
    36573659
    36583660    $cache_key = "get_pages:$key:$last_changed";
Note: See TracChangeset for help on using the changeset viewer.