#56650 closed defect (bug) (fixed)
Add more error checking to WP_List_Util::pluck
| Reported by: | afragen | Owned by: | audrasjb |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.2 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests commit |
| Cc: | Focuses: |
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.
4 years ago
#1
This ticket was mentioned in Slack in #core by afragen. View the logs.
4 years ago
This ticket was mentioned in Slack in #core by afragen. View the logs.
4 years ago
This ticket was mentioned in Slack in #core by afragen. View the logs.
4 years ago
#12
@
4 years ago
- Milestone Awaiting Review → 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.
4 years ago
This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.
4 years ago
#15
@
4 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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