r88076 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88075‎ | r88076 | r88077 >
Date:13:34, 14 May 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Fix bug in r87497, reported in CR: &modules=foo,bar,baz would look for '.foo', '.ar' and '.az' . Now handling prefixless modules correctly
Modified paths:
  • /trunk/phase3/includes/resourceloader/ResourceLoaderContext.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/resourceloader/ResourceLoaderContext.php
@@ -83,10 +83,16 @@
8484 } else {
8585 // This is a set of modules in foo.bar,baz notation
8686 $pos = strrpos( $group, '.' );
87 - $prefix = substr( $group, 0, $pos ); // 'foo'
88 - $suffixes = explode( ',', substr( $group, $pos + 1 ) ); // array( 'bar', 'baz' )
89 - foreach ( $suffixes as $suffix ) {
90 - $retval[] = "$prefix.$suffix";
 87+ if ( $pos === false ) {
 88+ // Prefixless modules, i.e. without dots
 89+ $retval = explode( ',', $group );
 90+ } else {
 91+ // We have a prefix and a bunch of suffixes
 92+ $prefix = substr( $group, 0, $pos ); // 'foo'
 93+ $suffixes = explode( ',', substr( $group, $pos + 1 ) ); // array( 'bar', 'baz' )
 94+ foreach ( $suffixes as $suffix ) {
 95+ $retval[] = "$prefix.$suffix";
 96+ }
9197 }
9298 }
9399 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r89666Added phpunit test cases for r87497, r88076: ResourceLoader module name prefi...brion17:56, 7 June 2011
r896761.17: MFT r82247, r87203, r87265, r87494, r87497, r87711, r87840, r88076, r89615catrope19:09, 7 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87497Per bug 28738 comment 4, pack ResourceLoader URLs by encoding foo.bar|foo.baz...catrope13:46, 5 May 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   17:56, 7 June 2011

phpunit test case added in r89666.

Status & tagging log