[wp-trac] [WordPress Trac] #58057: Replace loose comparison operator in plugins.php

WordPress Trac noreply at wordpress.org
Sun Apr 2 13:13:18 UTC 2023


#58057: Replace loose comparison operator in plugins.php
-----------------------------------------+-------------------------------
 Reporter:  sharif200                    |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Plugins                      |     Version:  trunk
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch changes-requested  |     Focuses:  coding-standards
-----------------------------------------+-------------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch => has-patch changes-requested
 * component:  General => Plugins


Comment:

 Hi there, welcome back to WordPress Trac! Thanks for the ticket.

 If you take a look at the comment directly above the line in question, it
 explains why strict comparison is not used here:
 {{{
 // Return early if all selected plugins already have auto-updates enabled
 or disabled.
 // Must use non-strict comparison, so that array order is not treated as
 significant.
 }}}
 So while ''something'' сould be done to replace the non-strict comparison
 in this code, simply using a strict comparison does not appear to be the
 correct solution here, as it will no longer work if the array order is
 different.

 Introduced in [47835] / #50052.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58057#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list