Make WordPress Core

Opened 23 months ago

Closed 23 months ago

Last modified 23 months ago

#58056 closed defect (bug) (fixed)

Fix non-strict equality check in /wp-admin/users.php Line No 148

Reported by: moinrrahmed's profile moinrrahmed Owned by: audrasjb's profile audrasjb
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch commit
Focuses: coding-standards Cc:

Description

A non-strict equality check issue on line 148 of the WordPress file /wp-admin/users.php. The original code uses the "==" operator instead of the "===" operator, which can lead to unexpected behavior in certain cases. The updated code uses the "===" operator for strict equality checking. This improves the security and stability of the WordPress core codebase.

Change History (5)

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


23 months ago
#1

  • Keywords has-patch added; needs-patch removed

This PR fixes a non-strict equality check issue on line 148 of the WordPress file /wp-admin/users.php. The original code uses the "==" operator instead of the "===" operator, which can lead to unexpected behavior in certain cases. The updated code uses the "===" operator for strict equality checking. This improves the security and stability of the WordPress core codebase.

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

#2 @SergeyBiryukov
23 months ago

  • Component changed from General to Users
  • Milestone changed from Awaiting Review to 6.3
  • Summary changed from Fix non-strict equality check in /w-admin/users.php Line No 148 to Fix non-strict equality check in /wp-admin/users.php Line No 148

#3 @audrasjb
23 months ago

  • Keywords commit added
  • Version trunk deleted

Hello @moinrrahmed, welcome to Trac and thanks for the ticket,

The change looks good to me, as $id is actually casted into an integer a few lines above this condition.

#4 @audrasjb
23 months ago

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

In 55622:

Coding Standards: Use strict comparison in wp-admin/users.php.

Follow-up to [10990], [11162], [11217], [37059], [55592].
Props moinrrahmed.
Fixes #58056.

Note: See TracTickets for help on using tickets.