GeezerVison is showing static-codereview.wikimedia.org — r88076 MediaWiki - Code Review archive
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)
|
| Index: trunk/phase3/includes/resourceloader/ResourceLoaderContext.php |
| — | — | @@ -83,10 +83,16 @@ |
| 84 | 84 | } else { |
| 85 | 85 | // This is a set of modules in foo.bar,baz notation |
| 86 | 86 | $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 | + } |
| 91 | 97 | } |
| 92 | 98 | } |
| 93 | 99 | } |
Follow-up revisions
| Revision | Commit summary | Author | Date |
|---|
| r89666 | Added phpunit test cases for r87497, r88076: ResourceLoader module name prefi... | brion | 17:56, 7 June 2011 |
| r89676 | 1.17: MFT r82247, r87203, r87265, r87494, r87497, r87711, r87840, r88076, r89615 | catrope | 19:09, 7 June 2011 |
Past revisions this follows-up on
| Revision | Commit summary | Author | Date |
|---|
| r87497 | Per bug 28738 comment 4, pack ResourceLoader URLs by encoding foo.bar|foo.baz... | catrope | 13:46, 5 May 2011 |
Comments
phpunit test case added in r89666.
Status & tagging log
|