r104030 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104029‎ | r104030 | r104031 >
Date:13:27, 23 November 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
(bug 29569) Avoid fatal errors in OutputPage when nonexistent module names are passed in
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -2476,7 +2476,8 @@
24772477 foreach ( (array) $modules as $name ) {
24782478 $module = $resourceLoader->getModule( $name );
24792479 # Check that we're allowed to include this module on this page
2480 - if ( ( $module->getOrigin() > $this->getAllowedModules( ResourceLoaderModule::TYPE_SCRIPTS )
 2480+ if ( !$module
 2481+ || ( $module->getOrigin() > $this->getAllowedModules( ResourceLoaderModule::TYPE_SCRIPTS )
24812482 && $only == ResourceLoaderModule::TYPE_SCRIPTS )
24822483 || ( $module->getOrigin() > $this->getAllowedModules( ResourceLoaderModule::TYPE_STYLES )
24832484 && $only == ResourceLoaderModule::TYPE_STYLES )
@@ -3127,7 +3128,11 @@
31283129 }
31293130
31303131 foreach ( $moduleStyles as $name ) {
3131 - $group = $resourceLoader->getModule( $name )->getGroup();
 3132+ $module = $resourceLoader->getModule( $name );
 3133+ if ( !$module ) {
 3134+ continue;
 3135+ }
 3136+ $group = $module->getGroup();
31323137 // Modules in groups named "other" or anything different than "user", "site" or "private"
31333138 // will be placed in the "other" group
31343139 $styles[isset( $styles[$group] ) ? $group : 'other'][] = $name;

Follow-up revisions

RevisionCommit summaryAuthorDate
r107907MFT r100348, r100640, r101656, r101867, r101869m r104030reedy17:34, 3 January 2012
r107956MFT r104030, r104033, r104146, r104671reedy22:45, 3 January 2012

Comments

#Comment by MarkAHershberger (talk | contribs)   22:44, 3 December 2011

Tagging for 1.18 re Bug #32762

Status & tagging log