$user = User::newFromName( $revision->getUserText( Revision::RAW ), false );
$content = $revision->getContent( Revision::RAW );
- //NOTE: article ID may not be known yet. prepareSave() should not modify the database.
+ // NOTE: article ID may not be known yet. prepareSave() should not modify the database.
$status = $content->prepareSave( $article, 0, -1, $user );
if ( !$status->isOK() ) {
$restored = 0;
foreach ( $result as $row ) {
- // Check for key dupes due to shitty archive integrity.
+ // Check for key dupes due to needed archive integrity.
if ( $row->ar_rev_id ) {
$exists = $dbw->selectField( 'revision', '1',
array( 'rev_id' => $row->ar_rev_id ), __METHOD__ );
Hooks::run( 'ArticleUndelete', array( &$this->title, $created, $comment, $oldPageId ) );
if ( $this->title->getNamespace() == NS_FILE ) {
- $update = new HTMLCacheUpdate( $this->title, 'imagelinks' );
- $update->doUpdate();
+ DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this->title, 'imagelinks' ) );
}
return Status::newGood( $restored );
}
protected function showHistory() {
+ $this->checkReadOnly();
+
$out = $this->getOutput();
if ( $this->mAllowed ) {
$out->addModules( 'mediawiki.special.undelete' );
throw new ErrorPageError( 'undelete-error', 'filedelete-maintenance' );
}
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkReadOnly();
$out = $this->getOutput();
$archive = new PageArchive( $this->mTargetObj, $this->getConfig() );