// FIXME: Horrible, horrible! This content-loading interface just plain sucks.
// We should instead work with the Revision object when we need it...
- $this->mContent = $revision->revText(); // Loads if user is allowed
+ $this->mContent = $revision->getText( false ); // Loads if user is allowed
$this->mUser = $revision->getUser();
$this->mUserText = $revision->getUserText();
* Fetch revision text if it's available to all users
* @return string
*/
- public function getText() {
- if( $this->isDeleted( self::DELETED_TEXT ) ) {
+ public function getText( $isPublic = true ) {
+ if( $isPublic && $this->isDeleted( self::DELETED_TEXT ) ) {
+ return "";
+ } else if( !$this->userCan( self::DELETED_TEXT ) ) {
return "";
} else {
return $this->getRawText();
return $this->mText;
}
- /**
- * Fetch revision text if it's available to THIS user
- * @return string
- */
- public function revText() {
- if( !$this->userCan( self::DELETED_TEXT ) ) {
- return "";
- } else {
- return $this->getRawText();
- }
- }
-
/**
* @return string
*/
return false;
}
if ( $this->mOldRev ) {
- $this->mOldtext = $this->mOldRev->revText();
+ $this->mOldtext = $this->mOldRev->getText( false );
if ( $this->mOldtext === false ) {
return false;
}
}
if ( $this->mNewRev ) {
- $this->mNewtext = $this->mNewRev->revText();
+ $this->mNewtext = $this->mNewRev->getText( false );
if ( $this->mNewtext === false ) {
return false;
}
$popts = $wgOut->parserOptions();
$popts->setEditSection( false );
$wgOut->parserOptions( $popts );
- $wgOut->addWikiTextTitleTidy( $rev->revText(), $this->mTargetObj, true );
+ $wgOut->addWikiTextTitleTidy( $rev->getText( false ), $this->mTargetObj, true );
}
$wgOut->addHtml(
'readonly' => 'readonly',
'cols' => intval( $wgUser->getOption( 'cols' ) ),
'rows' => intval( $wgUser->getOption( 'rows' ) ) ),
- $rev->revText() . "\n" ) .
+ $rev->getText( false ) . "\n" ) .
wfOpenElement( 'div' ) .
wfOpenElement( 'form', array(
'method' => 'post',