[wp-trac] [WordPress Trac] #31625: Function register_uninstall_hook doesn't have a method to remove the outdated data

WordPress Trac noreply at wordpress.org
Thu Oct 1 03:24:08 UTC 2015


#31625: Function register_uninstall_hook doesn't have a method to remove the
outdated data
--------------------------+--------------------------
 Reporter:  voron_eril    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.4
Component:  Plugins       |     Version:  4.1.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  performance
--------------------------+--------------------------
Changes (by dd32):

 * milestone:  Awaiting Review => 4.4


Comment:

 It looks like `register_uninstall_hook()` was used incorrect here in the
 first place, `register_uninstall_hook()` is designed to be given a
 function callback (or a static class variable), NOT a array/object
 instance like was provided here.

 We've blocked those being used since [16339] so the plugin in question
 would've had to be run over 5 years ago (Okay, so it could be more recent
 if they'd not updated their site).

 There's three options here:
  1. wontfix
  2. add a pre option save filter to make sure it only ever contains the
 right contents
  3. add a once-off upgrade routine to check to see if it contains any non-
 string/static callbacks

 I see nothing wrong with doing !#3 here, so if someone wants to whip up a
 patch before I do..

 Do we have any other arrays in options which store similar data?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31625#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list