X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FHooks.php;h=396e360dd88456997275eb405aa3c9b0b2113d58;hb=e6fb2a2c556379197dd63943f91f8fc9997c9632;hp=ed8b3edd845f8ab7c65c5168acf6e87bb62aadea;hpb=331bcf6ac9a5df389a0196ee71418d7620d34278;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Hooks.php b/includes/Hooks.php index ed8b3edd84..396e360dd8 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -126,6 +126,9 @@ class Hooks { * @param array $args Array of parameters passed to hook functions * @return bool True if no handler aborted the hook * + * @since 1.22 A hook function is not required to return a value for + * processing to continue. Not returning a value (or explicitly + * returning null) is equivalent to returning true. * @throws MWException * @throws FatalError */ @@ -210,14 +213,7 @@ class Hooks { 'Detected bug in an extension! ' . "Hook $func has invalid call signature; " . $badhookmsg ); - } elseif ( $retval === null ) { - // Null was returned. Error. - throw new MWException( - 'Detected bug in an extension! ' . - "Hook $func failed to return a value; " . - 'should return true to continue hook processing or false to abort.' - ); - } elseif ( !$retval ) { + } elseif ( $retval === false ) { wfProfileOut( 'hook: ' . $event ); // False was returned. Stop processing, but no error. return false;