Allow explicit & implicit null returns from hook handlers
authorOri Livneh <ori@wikimedia.org>
Mon, 24 Jun 2013 21:42:20 +0000 (14:42 -0700)
committerOri Livneh <ori@wikimedia.org>
Tue, 25 Jun 2013 19:10:12 +0000 (12:10 -0700)
commit5ff7e6fb7a36bfcf76b8cd7083fc5ea720db6b52
treeb4742924fa516b40f19e1e8aa15f7b334279b8db
parenta5963bb0678b0e20ff22f23df4a01265c1c83148
Allow explicit & implicit null returns from hook handlers

Most hook handlers are written with the intent of complementing or augmenting
core functionality rather than vetoing it, making it quite natural for a
developer to forget that the caller is waiting for permission to proceed. The
potential for confusion is magnified by the fact that DOM event handlers and
jQuery event handlers are not required to return an explicit value for the
handled event to continue propagating.

This change tolerates null return values (both implicit and explicit -- that
is, both 'return null' and no return statement at all) from hook handlers. To
abort processing, a hook function must return an explicit false or an error
string.

This change should not break any existing hook functions, as returning null is
currently an error.

Bug: 50134
Change-Id: I11deb2117ff9233c77868470f50e0d8f74053545
RELEASE-NOTES-1.22
includes/Hooks.php