[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 17:28:36 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:
-------------------------------------+---------------------------
Changes (by boonebgorges):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"34947"]:
 {{{
 #!CommitTicketReference repository="" revision="34947"
 Allow a null `id` to do a `name` lookup in `wp_set_current_user()`.

 Previously, the `name` fallback was failing in the case where the current
 user
 was 0, due to a loose comparison between 0 (the current user) and `null`
 (the
 value that is used to trigger the `name` fallback).

 Props bobbingwide.
 Fixes #20845.
 }}}

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


More information about the wp-trac mailing list