public $mCounter = -1; // !< Integer (-1 means "not loaded")
public $mDataLoaded = false; // !< Boolean
public $mIsRedirect = false; // !< Boolean
- public $mLatest = false; // !< Boolean
+ public $mLatest = false; // !< Integer (false means "not loaded")
public $mPreparedEdit = false; // !< Array
/**
* @var Title
*/
- public $mRedirectTarget = null;
+ protected $mRedirectTarget = null;
/**
* @var Revision
*/
- public $mLastRevision = null;
+ protected $mLastRevision = null;
- public $mTimestamp = ''; // !< String
- public $mTouched = '19700101000000'; // !< String
+ protected $mTimestamp = ''; // !< String
+ protected $mTouched = '19700101000000'; // !< String
/**@}}*/
/**
return $rt->getFullURL( 'rdfrom=' . urlencode( $source ) );
}
} else {
- if ( $rt->getNamespace() == NS_SPECIAL ) {
+ if ( $rt->isSpecialPage() ) {
// Gotta handle redirects to special pages differently:
// Fill the HTTP response "Location" header and ignore
// the rest of the page we're on.
return $wgEnableParserCache
&& $user->getStubThreshold() == 0
&& $this->exists()
- && empty( $oldid )
+ && ( $oldid === null || $oldid === 0 || $oldid === $this->getLatest() )
&& $this->mTitle->isWikitextPage();
}
if ( $section == 'new' ) {
# Inserting a new section
$subject = $summary ? wfMsgForContent( 'newsectionheaderdefaultlevel', $summary ) . "\n\n" : '';
- $text = strlen( trim( $oldtext ) ) > 0
+ if ( wfRunHooks( 'PlaceNewSection', array( $this, $oldtext, $subject, &$text ) ) ) {
+ $text = strlen( trim( $oldtext ) ) > 0
? "{$oldtext}\n\n{$subject}{$text}"
: "{$subject}{$text}";
+ }
} else {
# Replacing an existing section; roll out the big guns
global $wgParser;
*/
public function estimateRevisionCount() {
$dbr = wfGetDB( DB_SLAVE );
-
- // For an exact count...
- // return $dbr->selectField( 'revision', 'COUNT(*)',
- // array( 'rev_page' => $this->getId() ), __METHOD__ );
return $dbr->estimateRowCount( 'revision', '*',
array( 'rev_page' => $this->getId() ), __METHOD__ );
}
* roll back to, e.g. user is the sole contributor. This function
* performs permissions checks on $user, then calls commitRollback()
* to do the dirty work
+ *
+ * @todo: seperate the business/permission stuff out from backend code
*
* @param $fromP String: Name of the user whose edits to rollback.
* @param $summary String: Custom summary. Set to default summary if empty.