Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#58056 closed defect (bug) (fixed)

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

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

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.


3 years 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
3 years ago

  • Component GeneralUsers
  • Milestone Awaiting Review6.3
  • Summary Fix non-strict equality check in /w-admin/users.php Line No 148Fix non-strict equality check in /wp-admin/users.php Line No 148

#3 @audrasjb
3 years ago

  • Keywords commit added
  • Version trunk

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
3 years ago

  • Owner set to audrasjb
  • Resolutionfixed
  • Status newclosed

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.