r84396 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84395‎ | r84396 | r84397 >
Date:16:47, 20 March 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Fixup strpos logic, and swap setting of $lang (noticed it's wrong)

Add a comment

Follows up r84381
Modified paths:
  • /trunk/extensions/SiteMatrix/SiteMatrix_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SiteMatrix/SiteMatrix_body.php
@@ -255,10 +255,11 @@
256256 $matrix = new SiteMatrix();
257257
258258 $db = $wgDBname;
259 - $lang = $wgLanguageCode;
260 - if ( strpos( $wgDBname, $wgLanguageCode ) == 0 ) {
 259+ $lang = '';
 260+ //Strip language from DB name, if existent it should be at the start
 261+ if ( strpos( $wgDBname, $wgLanguageCode ) === 0 ) {
261262 $db = str_replace( $wgLanguageCode, '', $wgDBname );
262 - $lang = '';
 263+ $lang = $wgLanguageCode;
263264 }
264265
265266 if ( $matrix->isClosed( $lang, $db ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r84398Followup r84396 per CR...reedy16:56, 20 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84381* (bug 16288) API: consider making closure status of wikis more clear with me...reedy13:41, 20 March 2011

Comments

#Comment by IAlex (talk | contribs)   16:51, 20 March 2011

We have $wgConf->siteFromDB() for that.

Status & tagging log