Opened 16 years ago
Closed 16 years ago
#9116 closed defect (bug) (fixed)
remove_option_update_handler throws errors if new_whitelist_options is NULL
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.7.1 |
Component: | Plugins | Keywords: | has-patch tested |
Focuses: | Cc: |
Description
In version 2.7.1 the remove_option_update_handler function in plugin.php does an array search on the global $new_whitelist_options without checking first that the variable is indeed an array. My experience is that the variable is set when I activate and call register_setting(), but appears to always be NULL afterwards, and when I deactivate and call unregister_setting(), I get errors for a bad 2nd parameter to array_search: one for every option I attempt to unregister.
This should be an easy fix: either $new_whitelist_options needs to be declared as at least an empty array, or the array_search should only be run after checking that $new_whitelist_options is of type array.
Thanks,
Pamela
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
(In [11021]) Cast to array to avoid warning. Props Denis-de-Bernardy, pamelatech. fixes #9116