[wp-trac] [WordPress Trac] #38116: Introduce is_callable check into apply_filters function to avoid failure of call_user_func_array causing all filters to fail.

WordPress Trac noreply at wordpress.org
Thu Dec 19 15:23:33 UTC 2019


#38116: Introduce is_callable check into apply_filters function to avoid failure of
call_user_func_array causing all filters to fail.
-----------------------------+------------------------------
 Reporter:  garrett-eclipse  |       Owner:  (none)
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Plugins          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:
-----------------------------+------------------------------
Changes (by johnbillion):

 * keywords:   => needs-patch
 * version:  4.6.1 =>
 * type:  defect (bug) => enhancement


Comment:

 Silently discarding an invalid callback isn't a good idea because it turns
 a visible error into an invisible one.

 PHP errors exist for a reason and I think this is a valid case for an
 error. It's unfortunate that subsequent callbacks receive a null value, so
 if this guard condition is going to be put into place it needs to trigger
 a PHP error too.

 This will need performance profiling too to ensure there's minimal
 performance impact.

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


More information about the wp-trac mailing list