#56650 closed defect (bug) (fixed)
Add more error checking to WP_List_Util::pluck
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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.
3 years ago
#1
This ticket was mentioned in Slack in #core by afragen. View the logs.
3 years ago
This ticket was mentioned in Slack in #core by afragen. View the logs.
3 years ago
This ticket was mentioned in Slack in #core by afragen. View the logs.
3 years ago
#8
@
3 years ago
- Owner set to audrasjb
- Status changed from new to reviewing
Self assigning for final review.
#12
@
3 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.
3 years ago
This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.
3 years ago
#15
@
3 years 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.
3 years ago
@SergeyBiryukov commented on PR #3323:
3 years 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
elseaselseifto ensure$fieldis an array when it is treated as such.Trac ticket: https://core.trac.wordpress.org/ticket/56650