remove_option_update_handler throws errors if new_whitelist_options is NULL
|Reported by:||pamelatech||Owned by:|
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.