From 5114e8574737b68784dd698669e6597daab0a2a0 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 28 Feb 2013 16:53:48 +0000 Subject: [PATCH] In insert_blog(), make sure we retrieve the insertion ID from wpdb before calling a function that could invoke queries. props feedmeastraycat. fixes #23400. git-svn-id: https://develop.svn.wordpress.org/trunk@23511 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/ms-functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 45c2ed122a..8cf2c1ce8b 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -1104,8 +1104,9 @@ function insert_blog($domain, $path, $site_id) { if ( ! $result ) return false; - refresh_blog_details($wpdb->insert_id); - return $wpdb->insert_id; + $blog_id = $wpdb->insert_id; + refresh_blog_details( $blog_id ); + return $blog_id; } /**