diff options
author | Liangent <liangent@gmail.com> | 2013-06-01 15:52:26 +0000 |
---|---|---|
committer | Reedy <reedy@wikimedia.org> | 2013-08-09 09:32:13 +0000 |
commit | bc2915b7220e4cd7a511213ca54b67743361e684 (patch) | |
tree | cd29fb2074126958a2d7e99450019bf3a4374b4b | |
parent | f089e20bc00f6f6e6cc15b4fd8f81bbe9c3dc102 (diff) | |
download | mediawikicore-bc2915b7220e4cd7a511213ca54b67743361e684.tar.gz mediawikicore-bc2915b7220e4cd7a511213ca54b67743361e684.zip |
Attempt to remove a hard-coded "wikipedia".
Change-Id: I3c1567929eaa11a6ca0f3e8d7fe73653375b595b
-rw-r--r-- | includes/SiteConfiguration.php | 4 | ||||
-rw-r--r-- | tests/phpunit/includes/SiteConfigurationTest.php | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index 82344289e5b0..fa871fe0b3e9 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -477,13 +477,13 @@ class SiteConfiguration { $site = null; $lang = null; - foreach ( $this->suffixes as $suffix ) { + foreach ( $this->suffixes as $altSite => $suffix ) { if ( $suffix === '' ) { $site = ''; $lang = $db; break; } elseif ( substr( $db, -strlen( $suffix ) ) == $suffix ) { - $site = $suffix == 'wiki' ? 'wikipedia' : $suffix; + $site = is_numeric( $altSite ) ? $suffix : $altSite; $lang = substr( $db, 0, strlen( $db ) - strlen( $suffix ) ); break; } diff --git a/tests/phpunit/includes/SiteConfigurationTest.php b/tests/phpunit/includes/SiteConfigurationTest.php index 4cdf0201befa..181a9132e6d6 100644 --- a/tests/phpunit/includes/SiteConfigurationTest.php +++ b/tests/phpunit/includes/SiteConfigurationTest.php @@ -31,7 +31,7 @@ class SiteConfigurationTest extends MediaWikiTestCase { $this->mConf = new SiteConfiguration; - $this->mConf->suffixes = array( 'wiki' ); + $this->mConf->suffixes = array( 'wikipedia' => 'wiki' ); $this->mConf->wikis = array( 'enwiki', 'dewiki', 'frwiki' ); $this->mConf->settings = array( 'simple' => array( |