Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#33254 closed defect (bug) (fixed)

Access undefined $current_user in update_option_new_admin_email().

Reported by: Toro_Unit Owned by: ocean90
Priority: low Milestone: 4.3
Component: Networks and Sites Version: 4.2
Severity: trivial Keywords: has-patch commit
Cc: Focuses: multisite

Description

in update_option_new_admin_email.

	$content = str_replace( '###USERNAME###', $current_user->user_login, $content );

But undefined value $current_user.

Attachments (1)

patch.diff​ (616 bytes ) - added by Toro_Unit 11 years ago.

Download all attachments as: .zip

Change History (4)

@Toro_Unit
11 years ago

#1 @ocean90
11 years ago

  • Keywords has-patch commit added
  • Milestone Awaiting Review → 4.3
  • Priority normal → low
  • Severity normal → trivial
  • Version trunk → 4.2

Thanks for your report and the patch. Introduced/missed in [31403].

#2 @dd32
11 years ago

+1 looks good to me.

I have a feeling the code was supposed to be using global $current_user originally, but I have no issue with using the helper method instead.

#3 @ocean90
11 years ago

  • Owner set to ocean90
  • Resolution → fixed
  • Status new → closed

In 33569:

Multisite mails: Initialize $current_user before accessing $current_user->user_login.

props Toro_Unit.
see #31217.
fixes #33254.

Note: See TracTickets for help on using tickets.