will no longer be output and OutputPage::addKeyword no longer exists.
* Methods Title::userCanEditCssSubpage and Title::userCanEditJsSubpage,
deprecated since 1.19, have been removed.
+* (bug 50134) Hook functions are no longer required to return a value. When a
+ hook function does not return a value (or when it returns an explicit null),
+ processing continues. To abort the hook, a hook function must return an
+ explicit, boolean false or a string error message. Other falsey values are
+ tantamount to a 'return true' in earlier versions of MediaWiki.
== Compatibility ==
* @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
*/
'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;