Index: branches/titlerewrite/phase3/includes/Article.php |
— | — | @@ -731,7 +731,7 @@ |
732 | 732 | # diff page instead of the article. |
733 | 733 | |
734 | 734 | if ( !is_null( $diff ) ) { |
735 | | - $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); |
| 735 | + $wgOut->setPageTitle( $this->mTitle->getPrefixedText( $oldid ) ); |
736 | 736 | |
737 | 737 | $diff = $wgRequest->getVal( 'diff' ); |
738 | 738 | $htmldiff = $wgRequest->getVal( 'htmldiff' , false); |
— | — | @@ -868,7 +868,7 @@ |
869 | 869 | if( $this->mRevision->isDeleted( Revision::DELETED_TEXT ) ) { |
870 | 870 | if( !$this->mRevision->userCan( Revision::DELETED_TEXT ) ) { |
871 | 871 | $wgOut->addWikiMsg( 'rev-deleted-text-permission' ); |
872 | | - $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); |
| 872 | + $wgOut->setPageTitle( $this->mTitle->getPrefixedText( $oldid ) ); |
873 | 873 | wfProfileOut( __METHOD__ ); |
874 | 874 | return; |
875 | 875 | } else { |
— | — | @@ -927,7 +927,7 @@ |
928 | 928 | /* title may have been set from the cache */ |
929 | 929 | $t = $wgOut->getPageTitle(); |
930 | 930 | if( empty( $t ) ) { |
931 | | - $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); |
| 931 | + $wgOut->setPageTitle( $this->mTitle->getPrefixedText( $oldid ) ); |
932 | 932 | |
933 | 933 | # For the main page, overwrite the <title> element with the con- |
934 | 934 | # tents of 'pagetitle-view-mainpage' instead of the default (if |
— | — | @@ -2579,8 +2579,7 @@ |
2580 | 2580 | return array(array('notanarticle')); |
2581 | 2581 | } |
2582 | 2582 | |
2583 | | - $from = str_replace( '_', ' ', $fromP ); |
2584 | | - if( $from != $current->getUserText() ) { |
| 2583 | + if( $fromP != $current->getUser() ) { |
2585 | 2584 | $resultDetails = array( 'current' => $current ); |
2586 | 2585 | return array(array('alreadyrolled', |
2587 | 2586 | htmlspecialchars($this->mTitle->getPrefixedText()), |
— | — | @@ -2591,7 +2590,7 @@ |
2592 | 2591 | |
2593 | 2592 | # Get the last edit not by this guy |
2594 | 2593 | $user = intval( $current->getUser() ); |
2595 | | - $user_text = $dbw->addQuotes( $current->getUserText() ); |
| 2594 | + $user_text = $dbw->addQuotes( $current->getUser() ); |
2596 | 2595 | $s = $dbw->selectRow( 'revision', |
2597 | 2596 | array( 'rev_id', 'rev_timestamp', 'rev_deleted' ), |
2598 | 2597 | array( 'rev_page' => $current->getPage(), |
Index: branches/titlerewrite/phase3/includes/Title.php |
— | — | @@ -496,9 +496,27 @@ |
497 | 497 | |
498 | 498 | /** Simple accessors */ |
499 | 499 | /** |
| 500 | +<<<<<<< .mine |
500 | 501 | * Get the interface text form of the main part |
| 502 | + * @param \type{\int} the revision id of the ui title to use |
| 503 | +======= |
| 504 | + * Get the interface text form of the main part |
| 505 | +>>>>>>> .r42989 |
501 | 506 | * @return \type{\string} Main part of the title |
502 | 507 | */ |
| 508 | +<<<<<<< .mine |
| 509 | + public function getText( $oldid = 0 ) { |
| 510 | + if( !isset($this->mTextform) || $oldid != 0 ) { |
| 511 | + $rev = Revision::newFromTitle($this, $oldid); |
| 512 | + $ui = $rev ? $rev->getTitleUI() : null; |
| 513 | + $title = isset($ui) ? $ui |
| 514 | + : str_replace( '_', ' ', $this->mDbkeyform ); |
| 515 | + if( $oldid == 0 ) $this->mTextform = $title; |
| 516 | + return $title; |
| 517 | + } |
| 518 | + return $this->mTextform; |
| 519 | + } |
| 520 | +======= |
503 | 521 | public function getText() { |
504 | 522 | if( !isset($this->mTextform) ) { |
505 | 523 | $rev = Revision::newFromTitle($this); |
— | — | @@ -508,6 +526,7 @@ |
509 | 527 | } |
510 | 528 | return $this->mTextform; |
511 | 529 | } |
| 530 | +>>>>>>> .r42989 |
512 | 531 | /** |
513 | 532 | * Get the URL-encoded form of the main part |
514 | 533 | * @return \type{\string} Main part of the title, URL-encoded |
— | — | @@ -621,12 +640,21 @@ |
622 | 641 | /** |
623 | 642 | * Get the prefixed title with spaces. |
624 | 643 | * This is the form usually used for display |
| 644 | + * @param \type{\int} the revision id of the ui title to use |
625 | 645 | * @return \type{\string} the prefixed title, with spaces |
626 | 646 | */ |
| 647 | +<<<<<<< .mine |
| 648 | + public function getPrefixedText( $oldid = 0 ) { |
| 649 | + if ( !isset( $this->mPrefixedText ) || $oldid != 0 ) { |
| 650 | + $s = $this->prefix( $this->getText( $oldid ) ); |
| 651 | + if( $oldid == 0 ) $this->mPrefixedText = $s; |
| 652 | + return $s; |
| 653 | +======= |
627 | 654 | public function getPrefixedText() { |
628 | 655 | if ( empty( $this->mPrefixedText ) ) { // FIXME: bad usage of empty() ? |
629 | 656 | $s = $this->prefix( $this->getText() ); |
630 | 657 | $this->mPrefixedText = $s; |
| 658 | +>>>>>>> .r42989 |
631 | 659 | } |
632 | 660 | return $this->mPrefixedText; |
633 | 661 | } |
— | — | @@ -634,11 +662,12 @@ |
635 | 663 | /** |
636 | 664 | * Get the prefixed title with spaces, plus any fragment |
637 | 665 | * (part beginning with '#') |
| 666 | + * @param \type{\int} the revision id of the ui title to use |
638 | 667 | * @return \type{\string} the prefixed title, with spaces and |
639 | 668 | * the fragment, including '#' |
640 | 669 | */ |
641 | | - public function getFullText() { |
642 | | - $text = $this->getPrefixedText(); |
| 670 | + public function getFullText( $oldid = 0 ) { |
| 671 | + $text = $this->getPrefixedText( $oldid = 0 ); |
643 | 672 | if( '' != $this->mFragment ) { |
644 | 673 | $text .= '#' . $this->mFragment; |
645 | 674 | } |