From: daniel Date: Fri, 5 Oct 2012 17:11:50 +0000 (+0200) Subject: Make runLegacyHooks work around bug in Hooks. X-Git-Tag: 1.31.0-rc.0~22097^2^2~6^2 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=e6fb2cac0cc50e80ee16177db832926da5fdfcf6;p=lhc%2Fweb%2Fwiklou.git Make runLegacyHooks work around bug in Hooks. Hooks::isRegistered() doesn't consider hooks in $wgHooks. Until that is fixed (see I39bd5de2), we need to check that explicitely. Change-Id: I211c0c8bd0cd618151e56a11171ec8feef328d16 --- diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index 91da3e8bc0..99ae1673af 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -949,7 +949,9 @@ abstract class ContentHandler { * @return Boolean True if no handler aborted the hook */ public static function runLegacyHooks( $event, $args = array(), $warn = true ) { - if ( !Hooks::isRegistered( $event ) ) { + global $wgHooks; //@todo: once I39bd5de2 is merged, direct access to $wgHooks is no longer needed. + + if ( !Hooks::isRegistered( $event ) && empty( $wgHooks[$event] ) ) { return true; // nothing to do here }