registration: Improve error message for invalid "callback" in extension.json
[lhc/web/wiklou.git] / includes / registration / ExtensionRegistry.php
index eac04a9..bf33c6c 100644 (file)
@@ -332,6 +332,12 @@ class ExtensionRegistry {
                }
 
                foreach ( $info['callbacks'] as $name => $cb ) {
+                       if ( !is_callable( $cb ) ) {
+                               if ( is_array( $cb ) ) {
+                                       $cb = '[ ' . implode( ', ', $cb ) . ' ]';
+                               }
+                               throw new UnexpectedValueException( "callback '$cb' is not callable" );
+                       }
                        call_user_func( $cb, $info['credits'][$name] );
                }
        }