$this->mForReUpload = $request->getBool( 'wpForReUpload' ); // updating a file
$commentDefault = '';
- $commentMsg = wfMessage( 'upload-default-description' )->inContentLanguage();
+ $commentMsg = $this->msg( 'upload-default-description' )->inContentLanguage();
if ( !$this->mForReUpload && !$commentMsg->isDisabled() ) {
$commentDefault = $commentMsg->plain();
}
}
/**
- * Special page entry point
- * @param string $par
+ * @param string|null $par
* @throws ErrorPageError
* @throws Exception
* @throws FatalError
}
# Check blocks
- if ( $user->isBlocked() ) {
+ if ( $user->isBlockedFromUpload() ) {
throw new UserBlockedError( $user->getBlock() );
}
$this->loadRequest();
# Unsave the temporary file in case this was a cancelled upload
- if ( $this->mCancelUpload ) {
- if ( !$this->unsaveUploadedFile() ) {
- # Something went wrong, so unsaveUploadedFile showed a warning
- return;
- }
+ if ( $this->mCancelUpload && !$this->unsaveUploadedFile() ) {
+ # Something went wrong, so unsaveUploadedFile showed a warning
+ return;
}
# Process upload or show a form
);
$link = $this->msg( $user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted' )
->rawParams( $restorelink )->parseAsBlock();
- $this->getOutput()->addHTML( "<div id=\"contentSub2\">{$link}</div>" );
+ $this->getOutput()->addHTML(
+ Html::rawElement(
+ 'div',
+ [ 'id' => 'contentSub2' ],
+ $link
+ )
+ );
}
}
}
} elseif ( $warning == 'no-change' ) {
$file = $args;
$filename = $file->getTitle()->getPrefixedText();
- $msg = "\t<li>" . wfMessage( 'fileexists-no-change', $filename )->parse() . "</li>\n";
+ $msg = "\t<li>" . $this->msg( 'fileexists-no-change', $filename )->parse() . "</li>\n";
} elseif ( $warning == 'duplicate-version' ) {
$file = $args[0];
$count = count( $args );
$filename = $file->getTitle()->getPrefixedText();
- $message = wfMessage( 'fileexists-duplicate-version' )
+ $message = $this->msg( 'fileexists-duplicate-version' )
->params( $filename )
->numParams( $count );
$msg = "\t<li>" . $message->parse() . "</li>\n";
$ltitle = SpecialPage::getTitleFor( 'Log' );
$llink = $linkRenderer->makeKnownLink(
$ltitle,
- wfMessage( 'deletionlog' )->text(),
+ $this->msg( 'deletionlog' )->text(),
[],
[
'type' => 'delete',
'page' => Title::makeTitle( NS_FILE, $args )->getPrefixedText(),
]
);
- $msg = "\t<li>" . wfMessage( 'filewasdeleted' )->rawParams( $llink )->parse() . "</li>\n";
+ $msg = "\t<li>" . $this->msg( 'filewasdeleted' )->rawParams( $llink )->parse() . "</li>\n";
} elseif ( $warning == 'duplicate' ) {
$msg = $this->getDupeWarning( $args );
} elseif ( $warning == 'duplicate-archive' ) {
// Fetch the file if required
$status = $this->mUpload->fetchFile();
if ( !$status->isOK() ) {
- $this->showUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
+ $this->showUploadError( $this->getOutput()->parseAsInterface( $status->getWikiText() ) );
return;
}
$changeTagsStatus = ChangeTags::canAddTagsAccompanyingChange(
$changeTags, $this->getUser() );
if ( !$changeTagsStatus->isOK() ) {
- $this->showUploadError( $this->getOutput()->parse( $changeTagsStatus->getWikiText() ) );
+ $this->showUploadError( $this->getOutput()->parseAsInterface(
+ $changeTagsStatus->getWikiText()
+ ) );
return;
}
);
if ( !$status->isGood() ) {
- $this->showRecoverableUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
+ $this->showRecoverableUploadError(
+ $this->getOutput()->parseAsInterface( $status->getWikiText() )
+ );
return;
}