Make WordPress Core

Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#62012 closed defect (bug) (fixed)

Remove obsolete conditional in wp-admin/user-new.php

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.7 Priority: normal
Severity: normal Version: 3.0
Component: Users Keywords: good-first-bug has-patch commit
Focuses: administration Cc:

Description

As a result of mu:641, mu:1529, [12722], and [16294], there is a redundant condition in wp-admin/user-new.php:

$username = $user_details->user_login;
...
if ( null != $username && ... ) {

The null != $username part was initially added for $username = $wpdb->get_var() in mu:641, but now that $username is set to $user_details->user_login, it will never be null in this specific line, so this part of the conditional can be removed.

Attachments (1)

62012.patch (732 bytes) - added by iflairwebtechnologies 10 months ago.
Removed obsolete conditional in wp-admin/user-new.php and added 62012.patch

Download all attachments as: .zip

Change History (8)

This ticket was mentioned in PR #7311 on WordPress/wordpress-develop by @akshat2802.


10 months ago
#1

  • Keywords has-patch added; needs-patch removed

Trac ticket: https://core.trac.wordpress.org/ticket/62012

This PR removes Obsolete conditional in wp-admin/user-new.php

#2 @mukesh27
10 months ago

  • Keywords commit added

Thanks @akshat2802 for the PR.

PR ready for commit.

#3 @SergeyBiryukov
10 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 58999:

Users: Remove obsolete conditional in wp-admin/user-new.php.

Since $username is set to $user_details->user_login, it will never be null in this specific line.

Follow-up to mu:641, mu:1529, [12722], [16294].

Props akshat2802, mukesh27, aristath, SergeyBiryukov.
Fixes #62012.

@SergeyBiryukov commented on PR #7311:


10 months ago
#4

Thanks for the PR! Merged in r58999.

@iflairwebtechnologies
10 months ago

Removed obsolete conditional in wp-admin/user-new.php and added 62012.patch

@martin.krcho commented on PR #7340:


10 months ago
#6

@iflair this has already been merged in https://github.com/WordPress/wordpress-develop/commit/a30b9b444fbdd30d711f7e597794eb958764ea56.

You can close this issue.

@mukesh27 commented on PR #7340:


10 months ago
#7

Already merged.

Note: See TracTickets for help on using tickets.