[wp-trac] [WordPress Trac] #9116: remove_option_update_handler throws errors if new_whitelist_options is NULL

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 12 22:04:26 GMT 2009


#9116: remove_option_update_handler throws errors if new_whitelist_options is NULL
--------------------------+-------------------------------------------------
 Reporter:  pamelatech    |       Owner:       
     Type:  defect (bug)  |      Status:  new  
 Priority:  normal        |   Milestone:  2.7.2
Component:  Plugins       |     Version:  2.7.1
 Severity:  normal        |    Keywords:       
--------------------------+-------------------------------------------------
 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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/9116>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list