#57318 closed defect (bug) (fixed)
Coding Standards: Use strict comparison in wp-admin/includes/nav-menu.php
Reported by: | jenilk | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Menus | Keywords: | has-patch needs-testing-info |
Focuses: | coding-standards | Cc: |
Description
Coding Standards: Use strict comparison in wp-admin/includes/nav-menu.php
Attachments (1)
Change History (6)
#1
follow-up:
↓ 2
@
21 months ago
- Keywords has-patch needs-testing-info added
- Severity changed from major to normal
#2
in reply to:
↑ 1
@
21 months ago
Replying to johnbillion:
Thanks for the patch @jenilk! Are all of these variables guaranteed to be of the same type? For example data coming in via
$_POST
may be a string, etc.
@johnbillion - I made changes to the 4 places, and out of them, there are 2 places where the data is coming as $_POST for comparison. We can not be guaranteed of it will be of the same type(FYI we don't have declared variable with datatype specification).
#3
@
18 months ago
- Milestone changed from Awaiting Review to 6.3
Thanks for the patch!
In my testing, $_item_object_data['menu-item-db-id']
and $_POST['menu-item-db-id'][ $_key ]
can be a string and need a type cast to int
for correct comparison. The other two changes look good as is to me.
Note: See
TracTickets for help on using
tickets.
Thanks for the patch @jenilk! Are all of these variables guaranteed to be of the same type? For example data coming in via
$_POST
may be a string, etc.