Fix input regression affecting HTMLForms that use VForm
[lhc/web/wiklou.git] / includes / actions / RollbackAction.php
index d48a0ea..76d70d7 100644 (file)
@@ -39,6 +39,7 @@ class RollbackAction extends FormlessAction {
                $details = null;
 
                $request = $this->getRequest();
+               $user = $this->getUser();
 
                $result = $this->page->doRollback(
                        $request->getVal( 'from' ),
@@ -62,6 +63,7 @@ class RollbackAction extends FormlessAction {
                        $this->getOutput()->addWikiMsgArray( $errMsg, $errArray );
 
                        if ( isset( $details['current'] ) ) {
+                               /** @var Revision $current */
                                $current = $details['current'];
 
                                if ( $current->getComment() != '' ) {
@@ -85,6 +87,7 @@ class RollbackAction extends FormlessAction {
                        throw new ErrorPageError( 'rollbackfailed', $error[0], array_slice( $error, 1 ) );
                }
 
+               /** @var Revision $current */
                $current = $details['current'];
                $target = $details['target'];
                $newId = $details['newid'];
@@ -95,6 +98,11 @@ class RollbackAction extends FormlessAction {
                $new = Linker::revUserTools( $target );
                $this->getOutput()->addHTML( $this->msg( 'rollback-success' )->rawParams( $old, $new )
                        ->parseAsBlock() );
+
+               if ( $user->getBoolOption( 'watchrollback' ) ) {
+                       $user->addWatch( $this->page->getTitle(), WatchedItem::IGNORE_USER_RIGHTS );
+               }
+
                $this->getOutput()->returnToMain( false, $this->getTitle() );
 
                if ( !$request->getBool( 'hidediff', false ) &&