--- Patch file for get_blog_details caching fix
--- wp-includes/ms-blogs.php

@@ function get_blog_details( $fields = null, $get_all = true ) {
-    $blog_id = (int) $fields;
-    $details = wp_cache_get( $blog_id, 'blog-details' );
+    $blog_id = (int) $fields;
+    $cache_key = $get_all ? $blog_id . '-full' : $blog_id . '-short';
+    $details = wp_cache_get( $cache_key, 'blog-details' );

     if ( false === $details ) {
         global $wpdb;

-        if ( $get_all ) {
+        if ( $get_all ) {
             $details = $wpdb->get_row(
                 $wpdb->prepare(
                     "SELECT * FROM $wpdb->blogs WHERE blog_id = %d /* get_blog_details */",
                     $blog_id
                 )
             );
         } else {
             $details = $wpdb->get_row(
                 $wpdb->prepare(
                     "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE blog_id = %d /* get_blog_details (short) */",
                     $blog_id
                 )
             );
         }

         if ( null === $details ) {
             return false;
         }

         $details->blog_id = (int) $details->blog_id;

         // Add details to cache.
-        wp_cache_set( $blog_id, $details, 'blog-details' );
+        wp_cache_set( $cache_key, $details, 'blog-details' );
     }

     return $details;
 }