Index: trunk/extensions/Interlanguage/InterlanguageExtension.php |
— | — | @@ -1,10 +1,10 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * MediaWiki Interlanguage extension v1.4 |
| 4 | + * MediaWiki Interlanguage extension |
5 | 5 | * InterlanguageExtension class |
6 | 6 | * |
7 | 7 | * Copyright © 2008-2011 Nikola Smolenski <smolensk@eunet.rs> and others |
8 | | - * @version 1.4 |
| 8 | + * @version 1.5 |
9 | 9 | * |
10 | 10 | * This program is free software; you can redistribute it and/or modify |
11 | 11 | * it under the terms of the GNU General Public License as published by |
— | — | @@ -90,15 +90,7 @@ |
91 | 91 | global $wgInterlanguageExtensionDB; |
92 | 92 | |
93 | 93 | if( !$this->foreignDbr ) { |
94 | | - $foreignDbrClass = 'Database' . ucfirst( $wgInterlanguageExtensionDB['dbType'] ); |
95 | | - $this->foreignDbr = new $foreignDbrClass( |
96 | | - $wgInterlanguageExtensionDB['dbServer'], |
97 | | - $wgInterlanguageExtensionDB['dbUser'], |
98 | | - $wgInterlanguageExtensionDB['dbPassword'], |
99 | | - $wgInterlanguageExtensionDB['dbName'], |
100 | | - $wgInterlanguageExtensionDB['dbFlags'], |
101 | | - $wgInterlanguageExtensionDB['tablePrefix'] |
102 | | - ); |
| 94 | + $this->foreignDbr = wfGetDB( DB_SLAVE, array(), $wgInterlanguageExtensionDB ); |
103 | 95 | } |
104 | 96 | |
105 | 97 | list( $dbKey, $namespace ) = $this->getKeyNS( $param ); |
— | — | @@ -162,6 +154,8 @@ |
163 | 155 | function processLinks( $a, $param ) { |
164 | 156 | global $wgInterlanguageExtensionInterwiki; |
165 | 157 | |
| 158 | + // Be sure to set $res to bool false in case of failure |
| 159 | + $res = false; |
166 | 160 | if(isset($a['query']['pages']) && is_array($a['query']['pages'])) { |
167 | 161 | $a = array_shift($a['query']['pages']); |
168 | 162 | if( isset( $a['missing'] ) ) { |
— | — | @@ -175,9 +169,6 @@ |
176 | 170 | $a = $a['langlinks']; |
177 | 171 | if( is_array( $a ) ) { |
178 | 172 | $res = true; |
179 | | - } else { |
180 | | - // Be sure to set $res to bool false in case of failure |
181 | | - $res = false; |
182 | 173 | } |
183 | 174 | } else { |
184 | 175 | // There are no links in the central wiki article, so we display nothing |
Index: trunk/extensions/Interlanguage/Interlanguage.php |
— | — | @@ -1,9 +1,9 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * MediaWiki Interlanguage extension v1.4 |
| 4 | + * MediaWiki Interlanguage extension |
5 | 5 | * |
6 | 6 | * Copyright © 2008-2011 Nikola Smolenski <smolensk@eunet.rs> and others |
7 | | - * @version 1.4 |
| 7 | + * @version 1.5 |
8 | 8 | * |
9 | 9 | * This program is free software; you can redistribute it and/or modify |
10 | 10 | * it under the terms of the GNU General Public License as published by |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | 'name' => 'Interlanguage', |
36 | 36 | 'author' => 'Nikola Smolenski', |
37 | 37 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Interlanguage', |
38 | | - 'version' => '1.4', |
| 38 | + 'version' => '1.5', |
39 | 39 | 'descriptionmsg' => 'interlanguage-desc', |
40 | 40 | ); |
41 | 41 | $wgExtensionMessagesFiles['Interlanguage'] = dirname(__FILE__) . '/Interlanguage.i18n.php'; |