From 8fe09a809c0f76ebd8fb90d648eab2f3d7e31875 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: http://core.svn.wordpress.org/trunk@23511 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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; } /**