#58060 closed defect (bug) (duplicate)
Non-strict checking issue on line 209 of options-writing.php
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | has-patch |
Focuses: | coding-standards | Cc: |
Description
I have found a non-strict checking issue on this line of code. This means the code is not checking the value type returned by the 'get_option' function. It is possible that the value could be a non-numeric string or a boolean value other than true or false, which could lead to unexpected behavior in the code.
Change History (3)
This ticket was mentioned in PR #4291 on WordPress/wordpress-develop by @sharif200.
2 years ago
#1
- Keywords has-patch added; needs-patch removed
Note: See
TracTickets for help on using
tickets.
I have identified a non-strict checking issue on line 209 of the options-writing.php file in WordPress. The code checks the value of the 'blog_public' option using a non-strict comparison operator (==) instead of a strict comparison operator (===).
This can potentially lead to unexpected behavior if the value returned by the 'get_option' function is a non-numeric string or a boolean value other than true or false.
I have tested the proposed fix, which resolves the non-strict checking issue without causing any other issues. I have created a pull request with the fix and would appreciate it if someone from the WordPress core team could review and merge it. Thank you.
Trac ticket:
https://core.trac.wordpress.org/ticket/58060