Merge "Move up devunt's name to Developers"
[lhc/web/wiklou.git] / includes / actions / RollbackAction.php
index 65159f2..aa2858d 100644 (file)
@@ -54,9 +54,12 @@ class RollbackAction extends FormlessAction {
                $user = $this->getUser();
                $from = $request->getVal( 'from' );
                $rev = $this->page->getRevision();
-               if ( $from === null || $from === '' ) {
+               if ( $from === null ) {
                        throw new ErrorPageError( 'rollbackfailed', 'rollback-missingparam' );
                }
+               if ( !$rev ) {
+                       throw new ErrorPageError( 'rollbackfailed', 'rollback-missingrevision' );
+               }
                if ( $from !== $rev->getUserText() ) {
                        throw new ErrorPageError( 'rollbackfailed', 'alreadyrolled', [
                                $this->getTitle()->getPrefixedText(),
@@ -97,7 +100,7 @@ class RollbackAction extends FormlessAction {
                                }
                        }
 
-                       return true;
+                       return;
                }
 
                # NOTE: Permission errors already handled by Action::checkExecute.
@@ -142,7 +145,7 @@ class RollbackAction extends FormlessAction {
                        );
                        $de->showDiff( '', '' );
                }
-               return true;
+               return;
        }
 
        protected function getDescription() {