From: Chad Horohoe Date: Tue, 1 Mar 2011 17:54:15 +0000 (+0000) Subject: Kill all other uses of $wgHooks in includeExtensions() other than LoadExtensionSchema... X-Git-Tag: 1.31.0-rc.0~31703 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=5402421c95a7a26401b24662226b560806606d59;p=lhc%2Fweb%2Fwiklou.git Kill all other uses of $wgHooks in includeExtensions() other than LoadExtensionSchemaUpdates (which is the *only* one we want). People do stupid stuff in places like ParserFirstCallInit, and we don't want to risk them doing something like opening a DB connection or other things that are gonna fail --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index b812ad72c3..ae8b68afed 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1215,6 +1215,14 @@ abstract class Installer { require( "$path/$e/$e.php" ); } + $hooksWeWant = isset( $wgHooks['LoadExtensionSchemaUpdates'] ) ? + $wgHooks['LoadExtensionSchemaUpdates'] : array(); + + // Unset everyone else's hooks. Lord knows what someone might be doing + // in ParserFirstCallInit (see bug 27171) + unset( $wgHooks ); + $wgHooks = array( 'LoadExtensionSchemaUpdates' => $hooksWeWant ); + return Status::newGood(); }