Index: trunk/phase3/includes/interwiki/Interwiki.php |
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | /** |
203 | 203 | * Fetch all interwiki prefixes from interwiki cache |
204 | 204 | * |
205 | | - * @param $local If set, limits output to local/non-local interwikis |
| 205 | + * @param $local If not null, limits output to local/non-local interwikis |
206 | 206 | * @return Array List of prefixes |
207 | 207 | * @since 1.19 |
208 | 208 | */ |
— | — | @@ -245,7 +245,7 @@ |
246 | 246 | |
247 | 247 | list( $iw_local, $iw_url ) = explode( ' ', $row ); |
248 | 248 | |
249 | | - if ( isset( $local ) && $local != $iw_local ) { |
| 249 | + if ( $local !== null && $local != $iw_local ) { |
250 | 250 | continue; |
251 | 251 | } |
252 | 252 | |
— | — | @@ -265,7 +265,7 @@ |
266 | 266 | /** |
267 | 267 | * Fetch all interwiki prefixes from DB |
268 | 268 | * |
269 | | - * @param $local If set, limits output to local/non-local interwikis |
| 269 | + * @param $local If not null, limits output to local/non-local interwikis |
270 | 270 | * @return Array List of prefixes |
271 | 271 | * @since 1.19 |
272 | 272 | */ |
— | — | @@ -274,7 +274,7 @@ |
275 | 275 | |
276 | 276 | $where = array(); |
277 | 277 | |
278 | | - if ( isset( $local ) ) { |
| 278 | + if ( $local !== null ) { |
279 | 279 | if ( $local == 1 ) { |
280 | 280 | $where['iw_local'] = 1; |
281 | 281 | } elseif ( $local == 0 ) { |
— | — | @@ -282,10 +282,15 @@ |
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
286 | | - return $db->select( 'interwiki', |
| 286 | + $res = $db->select( 'interwiki', |
287 | 287 | array( 'iw_prefix', 'iw_url', 'iw_api', 'iw_wikiid', 'iw_local', 'iw_trans' ), |
288 | 288 | $where, __METHOD__, array( 'ORDER BY' => 'iw_prefix' ) |
289 | 289 | ); |
| 290 | + $retval = array(); |
| 291 | + foreach ( $res as $row ) { |
| 292 | + $retval[] = (array)$row; |
| 293 | + } |
| 294 | + return $retval; |
290 | 295 | } |
291 | 296 | |
292 | 297 | /** |
— | — | @@ -295,7 +300,7 @@ |
296 | 301 | * @return Array List of prefixes |
297 | 302 | * @since 1.19 |
298 | 303 | */ |
299 | | - public static function getAllPrefixes( $local ) { |
| 304 | + public static function getAllPrefixes( $local = null ) { |
300 | 305 | global $wgInterwikiCache; |
301 | 306 | |
302 | 307 | if ( $wgInterwikiCache ) { |