Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #23405


Ignore:
Timestamp:
02/06/2013 11:13:08 AM (12 years ago)
Author:
westi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23405 – Description

    initial v1  
    1 If you call '''get_blog_details''' for a blog which doesn't exist yet in '''wp_blogs''' then we cache a negative lookup result as '''-1''':
     1If you call {{{get_blog_details}}} for a blog which doesn't exist yet in {{{wp_blogs}}} then we cache a negative lookup result as {{{-1}}}:
    22
    33https://core.trac.wordpress.org/browser/trunk/wp-includes/ms-blogs.php?rev=23389#L217
    4 '''
     4{{{
    55        if ( empty($details) ) {
    66                $details = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE blog_id = %d /* get_blog_details */", $blog_id ) );
     
    1111                }
    1212        }
    13 '''
     13}}}
    1414
    15 When you then later call '''refresh_blog_details''' to clear up the cache for the blog_id the cached '''-1''' is passed to '''clean_blog_cache''' which then tries to get a blog_id from the object that was returned and doesn't get the right one and the cached are not deleted.
     15When you then later call {{{refresh_blog_details}}} to clear up the cache for the blog_id the cached {{{-1}}} is passed to {{{clean_blog_cache}}} which then tries to get a blog_id from the object that was returned and doesn't get the right one and the cached are not deleted.
    1616
    1717This means that the blog ends up broken :(