$this->getOutput()->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
}
- public function execute() {}
+ public function execute() {
+ }
}
/**
* @ingroup Actions
*/
class RevertFileAction extends FormAction {
+ /**
+ * @var OldLocalFile
+ */
protected $oldFile;
public function getName() {
$oldimage = $this->getRequest()->getText( 'oldimage' );
if ( strlen( $oldimage ) < 16
|| strpos( $oldimage, '/' ) !== false
- || strpos( $oldimage, '\\' ) !== false )
- {
+ || strpos( $oldimage, '\\' ) !== false
+ ) {
throw new ErrorPageError( 'internalerror', 'unexpected', array( 'oldimage', $oldimage ) );
}
- $this->oldFile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $this->getTitle(), $oldimage );
+ $this->oldFile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName(
+ $this->getTitle(),
+ $oldimage
+ );
+
if ( !$this->oldFile->exists() ) {
throw new ErrorPageError( '', 'filerevert-badversion' );
}
'raw' => true,
'default' => $this->msg( 'filerevert-intro',
$this->getTitle()->getText(), $userDate, $userTime,
- wfExpandUrl( $this->page->getFile()->getArchiveUrl( $this->getRequest()->getText( 'oldimage' ) ),
- PROTO_CURRENT ) )->parseAsBlock()
+ wfExpandUrl(
+ $this->page->getFile()->getArchiveUrl( $this->getRequest()->getText( 'oldimage' ) ),
+ PROTO_CURRENT
+ ) )->parseAsBlock()
),
'comment' => array(
'type' => 'text',
}
public function onSubmit( $data ) {
- $source = $this->page->getFile()->getArchiveVirtualUrl( $this->getRequest()->getText( 'oldimage' ) );
+ $source = $this->page->getFile()->getArchiveVirtualUrl(
+ $this->getRequest()->getText( 'oldimage' )
+ );
$comment = $data['comment'];
+
// TODO: Preserve file properties from database instead of reloading from file
- return $this->page->getFile()->upload( $source, $comment, $comment, 0, false, false, $this->getUser() );
+ return $this->page->getFile()->upload(
+ $source,
+ $comment,
+ $comment,
+ 0,
+ false,
+ false,
+ $this->getUser()
+ );
}
public function onSuccess() {
protected function getDescription() {
$this->getOutput()->addBacklinkSubtitle( $this->getTitle() );
+
return '';
}
}