[wp-trac] [WordPress Trac] #23400: insert_blog() can possible return the wrong blog id when plugin/theme uses refresh_blog_details action

WordPress Trac noreply at wordpress.org
Wed Feb 6 09:04:48 UTC 2013


#23400: insert_blog() can possible return the wrong blog id when plugin/theme uses
refresh_blog_details action
------------------------------+------------------
 Reporter:  feedmeastraycat   |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  3.6
Component:  Multisite         |     Version:  3.0
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+------------------

Comment (by feedmeastraycat):

 I uploaded [http://core.trac.wordpress.org/attachment/ticket/23400/insert-
 blog-bug.php insert-blog-bug.php] that is a plugin that duplicates the
 error.

 '''Warning'''
 Only run this on a clean install. To duplicate the error I truncate
 wp_posts and then changes the auto increment value to 100. This way, when
 a post is inserted it gets id 100 and the error is shown with
 insert_blog() returning 100 instead of the newly created actual blog id 2.

 Test it by creating a multi site install and then visiting http://your-
 test-site.com/?action=testbug - It will output "Created blog id: 100" if
 the bug was visible. If there is an error the WP_Error object us output
 using var_dump().

 [http://d.pr/i/8z2o This is a screenshot] of my tables after running the
 plugin.

 [http://d.pr/i/n6iV This is a screenshot] of the Sites panel in network
 admin.

 Running it will my patch creates everything ok.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23400#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list