r41154 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41153‎ | r41154 | r41155 >
Date:14:24, 22 September 2008
Author:aaron
Status:old
Tags:
Comment:
Remove Revision::revText() and move functionality to getText()
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/Revision.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -847,13 +847,13 @@
848848 return false;
849849 }
850850 if ( $this->mOldRev ) {
851 - $this->mOldtext = $this->mOldRev->revText();
 851+ $this->mOldtext = $this->mOldRev->getText( false );
852852 if ( $this->mOldtext === false ) {
853853 return false;
854854 }
855855 }
856856 if ( $this->mNewRev ) {
857 - $this->mNewtext = $this->mNewRev->revText();
 857+ $this->mNewtext = $this->mNewRev->getText( false );
858858 if ( $this->mNewtext === false ) {
859859 return false;
860860 }
Index: trunk/phase3/includes/Article.php
@@ -448,7 +448,7 @@
449449
450450 // FIXME: Horrible, horrible! This content-loading interface just plain sucks.
451451 // 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
453453
454454 $this->mUser = $revision->getUser();
455455 $this->mUserText = $revision->getUserText();
Index: trunk/phase3/includes/Revision.php
@@ -505,9 +505,11 @@
506506 * Fetch revision text if it's available to all users
507507 * @return string
508508 */
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 ) ) {
511511 return "";
 512+ } else if( !$this->userCan( self::DELETED_TEXT ) ) {
 513+ return "";
512514 } else {
513515 return $this->getRawText();
514516 }
@@ -526,20 +528,8 @@
527529 }
528530
529531 /**
530 - * Fetch revision text if it's available to THIS user
531532 * @return string
532533 */
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 - */
544534 public function getTimestamp() {
545535 return wfTimestamp(TS_MW, $this->mTimestamp);
546536 }
Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -787,7 +787,7 @@
788788 $popts = $wgOut->parserOptions();
789789 $popts->setEditSection( false );
790790 $wgOut->parserOptions( $popts );
791 - $wgOut->addWikiTextTitleTidy( $rev->revText(), $this->mTargetObj, true );
 791+ $wgOut->addWikiTextTitleTidy( $rev->getText( false ), $this->mTargetObj, true );
792792 }
793793
794794 $wgOut->addHtml(
@@ -795,7 +795,7 @@
796796 'readonly' => 'readonly',
797797 'cols' => intval( $wgUser->getOption( 'cols' ) ),
798798 'rows' => intval( $wgUser->getOption( 'rows' ) ) ),
799 - $rev->revText() . "\n" ) .
 799+ $rev->getText( false ) . "\n" ) .
800800 wfOpenElement( 'div' ) .
801801 wfOpenElement( 'form', array(
802802 'method' => 'post',

Follow-up revisions

RevisionCommit summaryAuthorDate
r41222Fixes for r41154 and r41155:...tstarling09:44, 24 September 2008