[wp-trac] [WordPress Trac] #58040: Replace non-strict checking in /wp-admin/users.php file

WordPress Trac noreply at wordpress.org
Sat Apr 1 11:44:26 UTC 2023


#58040: Replace non-strict checking in /wp-admin/users.php file
------------------------------+-----------------------------
 Reporter:  faisalahammad     |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  General           |    Version:  trunk
 Severity:  normal            |   Keywords:  needs-patch
  Focuses:  coding-standards  |
------------------------------+-----------------------------
 This PR replaces a non-strict checking issue on line 362 of the **/wp-
 admin/users.php** file in WordPress core. The current code uses the "=="
 operator instead of the "===" operator, which can lead to unexpected
 behavior due to type coercion.

 To fix this issue, we replace the "==" operator with the "===" operator to
 perform a strict comparison between the value of the $go_delete variable
 and the integer 1. This ensures that the comparison is done in a type-safe
 way and that unexpected behavior is avoided.

 The fixed code is as follows:

 {{{#!php
 <?php if ( 1 === $go_delete ) : ?>
 }}}

 With this fix, the code in the users.php file will be more reliable and
 less prone to unexpected behavior.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58040>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list