Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -847,13 +847,13 @@ |
848 | 848 | return false; |
849 | 849 | } |
850 | 850 | if ( $this->mOldRev ) { |
851 | | - $this->mOldtext = $this->mOldRev->revText(); |
| 851 | + $this->mOldtext = $this->mOldRev->getText( false ); |
852 | 852 | if ( $this->mOldtext === false ) { |
853 | 853 | return false; |
854 | 854 | } |
855 | 855 | } |
856 | 856 | if ( $this->mNewRev ) { |
857 | | - $this->mNewtext = $this->mNewRev->revText(); |
| 857 | + $this->mNewtext = $this->mNewRev->getText( false ); |
858 | 858 | if ( $this->mNewtext === false ) { |
859 | 859 | return false; |
860 | 860 | } |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -448,7 +448,7 @@ |
449 | 449 | |
450 | 450 | // FIXME: Horrible, horrible! This content-loading interface just plain sucks. |
451 | 451 | // We should instead work with the Revision object when we need it... |
452 | | - $this->mContent = $revision->revText(); // Loads if user is allowed |
| 452 | + $this->mContent = $revision->getText( false ); // Loads if user is allowed |
453 | 453 | |
454 | 454 | $this->mUser = $revision->getUser(); |
455 | 455 | $this->mUserText = $revision->getUserText(); |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -505,9 +505,11 @@ |
506 | 506 | * Fetch revision text if it's available to all users |
507 | 507 | * @return string |
508 | 508 | */ |
509 | | - public function getText() { |
510 | | - if( $this->isDeleted( self::DELETED_TEXT ) ) { |
| 509 | + public function getText( $isPublic = true ) { |
| 510 | + if( $isPublic && $this->isDeleted( self::DELETED_TEXT ) ) { |
511 | 511 | return ""; |
| 512 | + } else if( !$this->userCan( self::DELETED_TEXT ) ) { |
| 513 | + return ""; |
512 | 514 | } else { |
513 | 515 | return $this->getRawText(); |
514 | 516 | } |
— | — | @@ -526,20 +528,8 @@ |
527 | 529 | } |
528 | 530 | |
529 | 531 | /** |
530 | | - * Fetch revision text if it's available to THIS user |
531 | 532 | * @return string |
532 | 533 | */ |
533 | | - public function revText() { |
534 | | - if( !$this->userCan( self::DELETED_TEXT ) ) { |
535 | | - return ""; |
536 | | - } else { |
537 | | - return $this->getRawText(); |
538 | | - } |
539 | | - } |
540 | | - |
541 | | - /** |
542 | | - * @return string |
543 | | - */ |
544 | 534 | public function getTimestamp() { |
545 | 535 | return wfTimestamp(TS_MW, $this->mTimestamp); |
546 | 536 | } |
Index: trunk/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -787,7 +787,7 @@ |
788 | 788 | $popts = $wgOut->parserOptions(); |
789 | 789 | $popts->setEditSection( false ); |
790 | 790 | $wgOut->parserOptions( $popts ); |
791 | | - $wgOut->addWikiTextTitleTidy( $rev->revText(), $this->mTargetObj, true ); |
| 791 | + $wgOut->addWikiTextTitleTidy( $rev->getText( false ), $this->mTargetObj, true ); |
792 | 792 | } |
793 | 793 | |
794 | 794 | $wgOut->addHtml( |
— | — | @@ -795,7 +795,7 @@ |
796 | 796 | 'readonly' => 'readonly', |
797 | 797 | 'cols' => intval( $wgUser->getOption( 'cols' ) ), |
798 | 798 | 'rows' => intval( $wgUser->getOption( 'rows' ) ) ), |
799 | | - $rev->revText() . "\n" ) . |
| 799 | + $rev->getText( false ) . "\n" ) . |
800 | 800 | wfOpenElement( 'div' ) . |
801 | 801 | wfOpenElement( 'form', array( |
802 | 802 | 'method' => 'post', |