#56650 closed defect (bug) (fixed)
Add more error checking to WP_List_Util::pluck
Reported by: | afragen | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch has-unit-tests commit |
Focuses: | Cc: |
Description (last modified by )
$value
is checked to see if it is an object, but the else
doesn't check to see if $value
is an array.
I've found instances where null
is passed to WP_List_Util::pluck()
resulting in an error. Some additional error checking in the else
should solve this.
Change History (19)
This ticket was mentioned in PR #3323 on WordPress/wordpress-develop by afragen.
2 years ago
#1
This ticket was mentioned in Slack in #core by afragen. View the logs.
2 years ago
This ticket was mentioned in Slack in #core by afragen. View the logs.
2 years ago
This ticket was mentioned in Slack in #core by afragen. View the logs.
2 years ago
#8
@
2 years ago
- Owner set to audrasjb
- Status changed from new to reviewing
Self assigning for final review.
#12
@
2 years ago
- Milestone changed from Awaiting Review to 6.2
Thanks for the follow-up commit ;)
Moving this to milestone 6.2.
This ticket was mentioned in Slack in #core-upgrade-install by afragen. View the logs.
2 years ago
This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.
22 months ago
#15
@
22 months ago
This ticket was discussed during the recent bug scrub. It looks like it's unlikely that work will be done on this during the 6.2 cycle.
@audrasjb PR ready for re-review. Is this still possible to land in 6.2, or should it be moved to Future Release for now?
This ticket was mentioned in Slack in #core by costdev. View the logs.
22 months ago
@SergeyBiryukov commented on PR #3323:
22 months ago
#19
Thanks for the PR! Merged in r55423.
Note: As wp_list_pluck()
is just a wrapper and the actual source code change was in WP_List_Util::pluck()
, I have moved the tests to the class where all the other tests for WP_List_Util
are located.
Add a check to the
else
aselseif
to ensure$field
is an array when it is treated as such.Trac ticket: https://core.trac.wordpress.org/ticket/56650