[wp-trac] [WordPress Trac] #41987: Should use strict comparison at line 71 in wp-admin/admin.php

WordPress Trac noreply at wordpress.org
Tue Sep 26 03:37:36 UTC 2017


#41987: Should use strict comparison at line 71 in wp-admin/admin.php
-------------------------+-----------------------------
 Reporter:  rnaby        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Well, the both side of comparison has already been same data type, but I
 think it would be better if the comparison would be strict !

 Before or now the code looks like this-

 {{{#!php
 if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int)( $c / 50 ) ) == 1 ) ) {
 }}}

 After fix the code looks like this-

 {{{#!php
 if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int)( $c / 50 ) ) === 1 ) ) {
 }}}

 I think the later approach is better.

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


More information about the wp-trac mailing list