[wp-trac] [WordPress Trac] #20845: wp_set_current_user( null, "name") does not work when $current_user is already 0

WordPress Trac noreply at wordpress.org
Thu Oct 8 20:04:18 UTC 2015


#20845: wp_set_current_user( null, "name") does not work when $current_user is
already 0
-------------------------------------+---------------------------
 Reporter:  bobbingwide              |       Owner:  boonebgorges
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  4.4
Component:  Users                    |     Version:  3.3.2
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------------

Comment (by bobbingwide):

 Replying to [comment:18 boonebgorges]:
 > Replying to [comment:17 bobbingwide]:
 >
 > > Good spot. Will there need to be a test where?
 > > {{{
 > > ID=3 user_login="three"
 > > ID=4 user_login="3"
 > > }}}
 > >
 >
 > I don't think we need a separate case for that, since `$id` and `$name`
 are separate parameters. The only way they can be mixed up is by developer
 error, not by internal type mismatches.

 For this function it's OK. It's `WP_User::__construct()` that could do
 with the test.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/20845#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list