HomePhabricator

Changed the calling protocol for function wfRunHooks() in Hooks.php.

Description

Changed the calling protocol for function wfRunHooks() in Hooks.php.

Previously, this function used variable arguments to allow
different hooks to pass different parameters. However, var args
silently convert reference-calling to value-calling. So a call
that used to work like this:

  1. old wfRunHooks('SomeEvent', $param1, &$param2, $param3);

...now works like this:

  1. new wfRunHooks('SomeEvent', array($param1, &$param2, $param3));

Hook functions can now change pass-by-reference parameters correctly
(e.g. $param2 in the above example).

All calls to wfRunHooks() were changed and tested, and the change
was documented in docs/hooks.doc. This change was originally checked
in on REL1_4 branch as a bugfix, but per vibber reverted and checked
in to HEAD instead.

Details

Provenance
Evan ProdromouAuthored on
Parents
rMW06e6cd5d995e: * Appllied patch for bug 1686, image metadata cache by Andrius Ramanauskas. *…
Branches
Unknown
Tags
Unknown
ChangeId
None