# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- /Users/jpotkanski/Downloads/wordpress-mu/wp-includes/wpmu-functions.php
+++ /Users/jpotkanski/Documents/wordpressmu/trunk/source/wp-includes/wpmu-functions.php
@@ -1293,6 +1293,7 @@
 }
 
 function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) {
+	global $wpdb, $wp_queries;
 	$domain = preg_replace( "/\s+/", '', sanitize_user( $domain, true ) );
 	if( constant( 'VHOST' ) == 'yes' )
 		$domain = str_replace( '@', '', $domain );
@@ -1314,6 +1315,12 @@
 
 	switch_to_blog($blog_id);
 
+        if($wp_queries){
+            $pattern = '/' . $wpdb->base_prefix . '(\d+)/';
+            $prefix = $wpdb->base_prefix . $blog_id;
+            $wp_queries = preg_replace($pattern,$prefix, $wp_queries);
+        }
+
 	install_blog($blog_id, $title);
 
 	install_blog_defaults($blog_id, $user_id);
