From: Roan Kattouw Date: Wed, 23 Nov 2011 13:27:50 +0000 (+0000) Subject: (bug 29569) Avoid fatal errors in OutputPage when nonexistent module names are passed in X-Git-Tag: 1.31.0-rc.0~26332 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=88f5e7ae2460e84286a8cd33e41552a6b0d50dfe;p=lhc%2Fweb%2Fwiklou.git (bug 29569) Avoid fatal errors in OutputPage when nonexistent module names are passed in --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 398cddedac..9d5c5a1f20 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2476,7 +2476,8 @@ $templates foreach ( (array) $modules as $name ) { $module = $resourceLoader->getModule( $name ); # Check that we're allowed to include this module on this page - if ( ( $module->getOrigin() > $this->getAllowedModules( ResourceLoaderModule::TYPE_SCRIPTS ) + if ( !$module + || ( $module->getOrigin() > $this->getAllowedModules( ResourceLoaderModule::TYPE_SCRIPTS ) && $only == ResourceLoaderModule::TYPE_SCRIPTS ) || ( $module->getOrigin() > $this->getAllowedModules( ResourceLoaderModule::TYPE_STYLES ) && $only == ResourceLoaderModule::TYPE_STYLES ) @@ -3127,7 +3128,11 @@ $templates } foreach ( $moduleStyles as $name ) { - $group = $resourceLoader->getModule( $name )->getGroup(); + $module = $resourceLoader->getModule( $name ); + if ( !$module ) { + continue; + } + $group = $module->getGroup(); // Modules in groups named "other" or anything different than "user", "site" or "private" // will be placed in the "other" group $styles[isset( $styles[$group] ) ? $group : 'other'][] = $name;