Opened 13 months ago
Last modified 5 months ago
#57030 assigned defect (bug)
Condition is not strictly checked on options-general.php file
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Administration | Keywords: | has-patch changes-requested needs-unit-tests |
Focuses: | coding-standards | Cc: |
Description
In options-general.php file it is 0 is being compared with another variable which is $current_offset. As 0 is numeric value this needs to be compared.
Change History (7)
This ticket was mentioned in PR #3580 on WordPress/wordpress-develop by @rakibwordpress.
13 months ago
#1
#2
follow-up:
↓ 4
@
9 months ago
- Version changed from trunk to 3.0
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.
#3
@
9 months ago
- Component changed from General to Administration
- Focuses coding-standards added; administration removed
- Milestone changed from Awaiting Review to 6.3
- Owner set to SergeyBiryukov
- Status changed from new to assigned
#4
in reply to:
↑ 2
@
8 months ago
Replying to hellofromTonya:
Also a note for consideration:
Will$current_offset
always be an integer0
? Or could it be a string'0'
? The current code will type juggle to compare the values without comparing the data types.
This gets even more interesting, as the value can also be float
or false
, via wp_timezone_override_offset()
hooked to pre_option_gmt_offset
in wp-includes/default-filters.php
.
This ticket was mentioned in Slack in #core by oglekler. View the logs.
5 months ago
#6
@
5 months ago
- Keywords changes-requested needs-unit-tests added
This ticket was discussed in the recent bug scrub and due to lack of activity it was decided to move it into future release
.
This ticket needs some additional work and unit test as well. It can be moved to the next available milestone when it will be ready.
Props: @Clorith @costdev
Trac ticket: