* @ingroup Upload
* @ingroup JobQueue
*/
+use Wikimedia\ScopedCallback;
/**
* Upload a file from the upload stash into the local file repo.
}
public function run() {
- /** @noinspection PhpUnusedLocalVariableInspection */
$scope = RequestContext::importScopedSession( $this->params['session'] );
$this->addTeardownCallback( function () use ( &$scope ) {
ScopedCallback::consume( $scope ); // T126450
$this->params['text'],
$this->params['watch'],
$user,
- isset( $this->params['tags'] ) ? $this->params['tags'] : []
+ $this->params['tags'] ?? []
);
if ( !$status->isGood() ) {
UploadBase::setSessionStatus(
$this->params['filekey'],
[ 'result' => 'Failure', 'stage' => 'publish', 'status' => $status ]
);
- $this->setLastError( $status->getWikiText() );
+ $this->setLastError( $status->getWikiText( false, false, 'en' ) );
return false;
}
);
$this->setLastError( get_class( $e ) . ": " . $e->getMessage() );
// To prevent potential database referential integrity issues.
- // See bug 32551.
+ // See T34551.
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
return false;