﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
23405,blog-details cache can get stuck with bad value,westi,ryan,"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}}}:

https://core.trac.wordpress.org/browser/trunk/wp-includes/ms-blogs.php?rev=23389#L217
{{{
        if ( empty($details) ) {
                $details = $wpdb->get_row( $wpdb->prepare( ""SELECT * FROM $wpdb->blogs WHERE blog_id = %d /* get_blog_details */"", $blog_id ) );
                if ( ! $details ) {
                        // Set the full cache.
                        wp_cache_set( $blog_id, -1, 'blog-details' );
                        return false;
                }
        }
}}}

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.

This means that the blog ends up broken :(",defect (bug),closed,normal,3.6,Multisite,3.5.1,normal,fixed,has-patch,hirozed
