Index: trunk/extensions/CentralAuth/SpecialCentralAuth.php |
— | — | @@ -430,9 +430,13 @@ |
431 | 431 | } |
432 | 432 | |
433 | 433 | function foreignLink( $wikiID, $title, $text, $hint = '', $params = '' ) { |
434 | | - $wiki = WikiMap::getWiki( $wikiID ); |
435 | | - if( !$wiki ) { |
436 | | - throw new MWException( "Invalid wiki: $wikiID" ); |
| 434 | + if ( $wikiID instanceof WikiReference ) { |
| 435 | + $wiki = $wikiID; |
| 436 | + } else { |
| 437 | + $wiki = WikiMap::getWiki( $wikiID ); |
| 438 | + if( !$wiki ) { |
| 439 | + throw new MWException( "Invalid wiki: $wikiID" ); |
| 440 | + } |
437 | 441 | } |
438 | 442 | |
439 | 443 | $url = $wiki->getUrl( $title ); |
— | — | @@ -448,9 +452,13 @@ |
449 | 453 | |
450 | 454 | function foreignUserLink( $wikiID ) { |
451 | 455 | $wiki = WikiMap::getWiki( $wikiID ); |
| 456 | + if( !$wiki ) { |
| 457 | + throw new MWException( "Invalid wiki: $wikiID" ); |
| 458 | + } |
| 459 | + |
452 | 460 | $wikiname = $wiki->getDisplayName(); |
453 | 461 | return $this->foreignLink( |
454 | | - $wikiID, |
| 462 | + $wiki, |
455 | 463 | 'User:' . $this->mUserName, |
456 | 464 | $wikiname, |
457 | 465 | wfMsg( 'centralauth-foreign-link', $this->mUserName, $wikiname ) ); |