Index: branches/wmf/1.17wmf1/extensions/WikimediaIncubator/SpecialViewUserLang.php |
— | — | @@ -75,11 +75,10 @@ |
76 | 76 | // show error if a user with that name does not exist |
77 | 77 | $wgOut->addHTML( Xml::span( wfMsg( 'wminc-userdoesnotexist', $target ), 'error' ) ); |
78 | 78 | } else { |
79 | | - $prefix = IncubatorTest::displayPrefix( |
80 | | - $user->getOption( $wmincPref . '-project' ), |
81 | | - $user->getOption( $wmincPref . '-code' ) |
82 | | - ); |
83 | | - if ( IncubatorTest::isContentProject() ) { |
| 79 | + $userproject = $user->getOption( $wmincPref . '-project' ); |
| 80 | + $usercode = $user->getOption( $wmincPref . '-code' ); |
| 81 | + $prefix = IncubatorTest::displayPrefix( $userproject, $usercode ); |
| 82 | + if ( IncubatorTest::isContentProject( $userproject ) ) { |
84 | 83 | $testwiki = $sk->link( Title::newFromText( $prefix ) ); |
85 | 84 | } elseif ( $prefix == $wmincProjectSite['short'] ) { |
86 | 85 | $testwiki = htmlspecialchars( $wmincProjectSite['name'] ); |
Index: branches/wmf/1.17wmf1/extensions/WikimediaIncubator/IncubatorTest.php |
— | — | @@ -125,15 +125,16 @@ |
126 | 126 | */ |
127 | 127 | static function displayPrefix( $project = '', $code = '' ) { |
128 | 128 | global $wgUser, $wmincPref; |
129 | | - if ( ($project && $code) || self::isContentProject() ) { |
| 129 | + $projectvalue = ( $project ? $project : $wgUser->getOption($wmincPref . '-project') ); |
| 130 | + $codevalue = ( $code ? $code : $wgUser->getOption($wmincPref . '-code') ); |
| 131 | + if ( self::isContentProject( $projectvalue ) ) { |
130 | 132 | // if parameters are set OR it falls back to user pref and |
131 | 133 | // he has a content project pref set -> return the prefix |
132 | | - return 'W' . ( $project ? $project : $wgUser->getOption($wmincPref . '-project') ) . |
133 | | - '/' . ( $code ? $code : $wgUser->getOption($wmincPref . '-code') ); // return the prefix |
| 134 | + return 'W' . $projectvalue . '/' . $codevalue; // return the prefix |
134 | 135 | } else { |
135 | 136 | // fall back to user pref with NO content pref set |
136 | 137 | // -> still provide the value (probably 'none' or 'inc') |
137 | | - return $wgUser->getOption($wmincPref . '-project'); |
| 138 | + return $projectvalue; |
138 | 139 | } |
139 | 140 | } |
140 | 141 | |