WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 6 months ago

#40632 closed defect (bug) (worksforme)

Fix undefined index notice in wp-includes/user.php

Reported by: arkimedia Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7.4
Component: Users Keywords: close reporter-feedback
Focuses: Cc:

Description

Current solution only checks if $userdata['user_pass'] is not empty, but it doesn't test if index exists.

In attached diff file, isset check have been added in order to fix undefined index notice in wp-includes/user.php on line 1431.

Attachments (1)

user-pass.diff (578 bytes) - added by arkimedia 4 years ago.
Fix undefined index notice

Download all attachments as: .zip

Change History (5)

@arkimedia
4 years ago

Fix undefined index notice

#1 @Hareesh Pillai
7 months ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to 5.8

#2 @SergeyBiryukov
7 months ago

  • Keywords close reporter-feedback added; needs-refresh removed
  • Milestone changed from 5.8 to Awaiting Review

Hi @arkimedia, thanks for the ticket and the patch! Sorry it took so long for someone to get back to you.

! empty() is essentially the concise equivalent to isset( $var ) && $var != false, it can be used to check for existence of an array index or object property directly, so an additional isset() check would be redundant.

If the issue is still relevant, could you provide the steps to reproduce it on a clean install? I think the notice might have been about $old_user_data->user_pass instead, but I have not seen any other reports of it.

#4 @SergeyBiryukov
6 months ago

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

Closing per comment:2, feel free to reopen if there's still an issue.

Note: See TracTickets for help on using tickets.