Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#28466 closed enhancement (wontfix)

Remove unused/misleading variable in wpmu_signup_blog_notification()

Reported by: iamfriendly's profile iamfriendly Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Login and Registration Keywords: has-patch
Focuses: multisite Cc:

Description

The $message variable in wpmu_signup_blog_notification() contains an unused $key variable that is now part of the $activate_url var. It's been removed from the string in the sprintf call but not from the variables passed to it.
The attached patch removes the unnecessary and unused variable.

Attachments (1)

28466.diff (1.1 KB) - added by iamfriendly 12 years ago.
Remove unused variable in wpmu_signup_blog_notification()

Download all attachments as: .zip

Change History (6)

@iamfriendly
12 years ago

Remove unused variable in wpmu_signup_blog_notification()

#1 @kpdesign
12 years ago

  • Focuses multisite added
  • Keywords has-patch added

#2 @jeremyfelt
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

The addition of this $key variable dates back to changeset MU1977 due to the reasoning in ticket MU1119

It's interesting the ticket mentions adding $key to the filter, though it's really adding it to be used in sprintf().

It is possible that somebody is using the wpmu_signup_blog_notification_email filter to alter the original message to account for that 3rd variable. Because of this, I don't think that we can remove it.

#3 @iamfriendly
12 years ago

But the $key variable isn't actually passed to the sprintf call. There's only two placeholders and the $key variable is a third. Which isn't actually available in the string. Unless I'm mis-reading it, Jeremy?

#4 @jeremyfelt
12 years ago

The default message only uses %s twice, but if I were to use the filter to change that to something else that does have three placeholders - like "Hi, activate at %s, then login at %s, by the way your key is %s" - it would pick it up.

#5 @iamfriendly
12 years ago

Of course! I'm an idiot. I should not try and think this stuff through when I'm hungover ;)

Note: See TracTickets for help on using tickets.