Index: trunk/phase3/includes/Linker.php |
— | — | @@ -305,6 +305,11 @@ |
306 | 306 | } |
307 | 307 | |
308 | 308 | private function linkText( $target ) { |
| 309 | + # We might be passed a non-Title by make*LinkObj(). Fail gracefully. |
| 310 | + if( !$target instanceof Title ) { |
| 311 | + return ''; |
| 312 | + } |
| 313 | + |
309 | 314 | # If the target is just a fragment, with no title, we return the frag- |
310 | 315 | # ment text. Otherwise, we return the title text itself. |
311 | 316 | if( $target->getPrefixedText() === '' and $target->getFragment() !== '' ) { |
— | — | @@ -426,7 +431,7 @@ |
427 | 432 | * the end of the link. |
428 | 433 | * @param $prefix String: optional prefix. As trail, only before instead of after. |
429 | 434 | */ |
430 | | - function makeLinkObj( Title $nt, $text= '', $query = '', $trail = '', $prefix = '' ) { |
| 435 | + function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) { |
431 | 436 | global $wgUser; |
432 | 437 | wfProfileIn( __METHOD__ ); |
433 | 438 | |
— | — | @@ -458,7 +463,7 @@ |
459 | 464 | * @param $style String: style to apply - if empty, use getInternalLinkAttributesObj instead |
460 | 465 | * @return the a-element |
461 | 466 | */ |
462 | | - function makeKnownLinkObj( Title $title, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) { |
| 467 | + function makeKnownLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) { |
463 | 468 | wfProfileIn( __METHOD__ ); |
464 | 469 | |
465 | 470 | if ( $text == '' ) { |
— | — | @@ -490,7 +495,7 @@ |
491 | 496 | * be included in the link text. Other characters will be appended after |
492 | 497 | * the end of the link. |
493 | 498 | */ |
494 | | - function makeBrokenLinkObj( Title $title, $text = '', $query = '', $trail = '', $prefix = '' ) { |
| 499 | + function makeBrokenLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '' ) { |
495 | 500 | wfProfileIn( __METHOD__ ); |
496 | 501 | |
497 | 502 | list( $inside, $trail ) = Linker::splitTrail( $trail ); |