[wp-trac] [WordPress Trac] #13246: wp_set_post_categories assumes $post_categories has a value in [0], but wp_insert_post doesn't assign the default category there

WordPress Trac wp-trac at lists.automattic.com
Tue May 4 06:27:46 UTC 2010


#13246: wp_set_post_categories assumes $post_categories has a value in [0], but
wp_insert_post doesn't assign the default category there
--------------------------+-------------------------------------------------
 Reporter:  jorbin        |       Owner:  filosofo 
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  3.0      
Component:  Taxonomy      |     Version:  3.0      
 Severity:  normal        |    Keywords:  has-patch
--------------------------+-------------------------------------------------
 right now wp_insert post assigns the default category to a post just as an
 array item which should be in the 0 ofset.  However this isn't guaranteed.
 If we cast it as the 0 offset in wp_insert_post, this solves the problem

 To reproduce:

 on a vanilla install with wp_debug enabled, add a post modifying the
 categories.  This causes the following error: Notice: Undefined offset: 0
 in /opt/lampp/htdocs/amun/wp/trunk/wp-includes/post.php on line 2561

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13246>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list