Add name of offensive hook function to error message
authorStephan Gambke <s7eph4n@gmail.com>
Thu, 9 Oct 2014 13:56:31 +0000 (15:56 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 10 Oct 2014 15:11:04 +0000 (15:11 +0000)
When a hook function is not callable an exception is thrown.

This patch adds the name of the offensive hook function to
the exception message to improve its informative value.

Change-Id: I376d7f5590099620a4c11ff9a4967d6d8f6560cc

includes/Hooks.php

index 2928748..668c3d9 100644 (file)
@@ -179,7 +179,7 @@ class Hooks {
                        // Run autoloader (workaround for call_user_func_array bug)
                        // and throw error if not callable.
                        if ( !is_callable( $callback ) ) {
-                               throw new MWException( 'Invalid callback in hooks for ' . $event . "\n" );
+                               throw new MWException( 'Invalid callback ' . $func . ' in hooks for ' . $event . "\n" );
                        }
 
                        /*