[wp-trac] [WordPress Trac] #58061: Replace '==' with '===' in wp-admin/update-core.php

WordPress Trac noreply at wordpress.org
Sun Apr 2 16:30:24 UTC 2023


#58061: Replace '==' with '===' in wp-admin/update-core.php
------------------------------+-----------------------------
 Reporter:  wpfy              |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  General           |    Version:  trunk
 Severity:  normal            |   Keywords:  needs-patch
  Focuses:  coding-standards  |
------------------------------+-----------------------------
 The WordPress PHP coding standards recommend using the strict equality
 operator '===' instead of '==' when checking conditions. This is because
 '==' performs type coercion, which can lead to unexpected results or
 security issues in some cases.

 However, the WordPress core file wp-admin/update-core.php, on line 184,
 uses '=='. To ensure consistency with the WordPress coding standards and
 improve the security and stability of the code, I propose replacing '=='
 with '===' on this line.

 This change will ensure that the comparison is performed using strict type
 checking, preventing any unexpected type coercion or security issues that
 may arise due to loose comparisons.

 With this change, I will create a pull request to the WordPress core
 repository.

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


More information about the wp-trac mailing list