From: umherirrender Date: Mon, 27 Jul 2015 19:04:36 +0000 (+0200) Subject: Updater: Avoid fatal on wfLoadSkin/wfLoadExtension X-Git-Tag: 1.31.0-rc.0~10621^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=621521601ad0cf0fdb7509bc8d85438b20bc8c84;p=lhc%2Fweb%2Fwiklou.git Updater: Avoid fatal on wfLoadSkin/wfLoadExtension When having $wgExtensionDirectory or $wgStyleDirectory set to a different location in LocalSettings.php, the load of LocalSettings.php can give fatal, because the called functions wfLoadSkin and wfLoadExtensions need at least this globals to be set correctly. This does not bring the vector skin back to the updater, when having the globals set, but it avoids a fatal about "MonoBook/skin.json does not exist!" or similar. Change-Id: I095c545f77aa50d6be4cd48588bd1ae1c82cf343 --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 28183497a3..c4a9b76ba7 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -538,6 +538,10 @@ abstract class Installer { global $wgAutoloadClasses; $wgAutoloadClasses = array(); + // LocalSettings.php should not call functions, except wfLoadSkin/wfLoadExtensions + // Define the requiered globals here, to ensure, the functions can do it work correctly. + global $wgExtensionDirectory, $wgStyleDirectory; + MediaWiki\suppressWarnings(); $_lsExists = file_exists( "$IP/LocalSettings.php" ); MediaWiki\restoreWarnings();