r89561 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89560‎ | r89561 | r89562 >
Date:12:18, 6 June 2011
Author:catrope
Status:ok
Tags:
Comment:
1.17wmf1: MFT r89560
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/WikimediaIncubator/IncubatorTest.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/WikimediaIncubator/IncubatorTest.php
@@ -76,7 +76,7 @@
7777 if( !is_array( $titleparts ) || !isset( $titleparts[1] ) ) {
7878 $data['error'] = 'noslash';
7979 } else {
80 - $data['project'] = $titleparts[0][1]; // get the x from Wx/...
 80+ $data['project'] = ( isset( $titleparts[0][1] ) ? $titleparts[0][1] : '' ); // get the x from Wx/...
8181 $data['lang'] = $titleparts[1];
8282 $data['prefix'] = 'W'.$data['project'].'/'.$data['lang'];
8383 // check language code
@@ -125,12 +125,14 @@
126126 */
127127 static function displayPrefix( $project = '', $code = '' ) {
128128 global $wgUser, $wmincPref;
129 - if ( self::isContentProject() ) {
130 - // return the prefix
 129+ if ( ($project && $code) || self::isContentProject() ) {
 130+ // if parameters are set OR it falls back to user pref and
 131+ // he has a content project pref set -> return the prefix
131132 return 'W' . ( $project ? $project : $wgUser->getOption($wmincPref . '-project') ) .
132133 '/' . ( $code ? $code : $wgUser->getOption($wmincPref . '-code') ); // return the prefix
133134 } else {
134 - // still provide the value
 135+ // fall back to user pref with NO content pref set
 136+ // -> still provide the value (probably 'none' or 'inc')
135137 return $wgUser->getOption($wmincPref . '-project');
136138 }
137139 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89560fix displayPrefix: parameters didn't work when preference was not a content p...robin12:01, 6 June 2011

Status & tagging log