[wp-trac] [WordPress Trac] #57030: Condition is not strictly checked on options-general.php file

WordPress Trac noreply at wordpress.org
Wed Mar 8 16:27:02 UTC 2023


#57030: Condition is not strictly checked on options-general.php file
----------------------------+------------------------------
 Reporter:  rakibwordpress  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  General         |     Version:  3.0
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  administration
----------------------------+------------------------------
Changes (by hellofromTonya):

 * version:  trunk => 3.0


Comment:

 Hello @rakibwordpress,

 Welcome back to WordPress Core's Trac!

 I'm doing some triage for open tickets against `trunk` to see if the
 defect was introduced in the 6.2.0 cycle. For this one, the code is from
 3.0.0, introduced via [12507] / #11558. Changing the `Version` number.

 Also a note for consideration:
 Will `$current_offset` ''always''**** be an integer `0`? Or could it be a
 string `'0'`? The current code will type juggle to compare the values
 without comparing the data types.

 What I'm wondering (haven't looked deeply into it):
 Is there a strict requirement that 0 must be an integer data type?

 If no, then `===` could cause a backwards-compatibility issue or break in
 the code when it's a string 0.

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


More information about the wp-trac mailing list