Merge "Hard deprecate codepaths where tidy is disabled"
[lhc/web/wiklou.git] / includes / api / ApiRollback.php
index d2ff790..db57f7e 100644 (file)
@@ -55,6 +55,11 @@ class ApiRollback extends ApiBase {
                        }
                }
 
+               // @TODO: remove this hack once rollback uses POST (T88044)
+               $trxLimits = $this->getConfig()->get( 'TrxProfilerLimits' );
+               $trxProfiler = Profiler::instance()->getTransactionProfiler();
+               $trxProfiler->setExpectations( $trxLimits['POST'], __METHOD__ );
+
                $retval = $pageObj->doRollback(
                        $this->getRbUser( $params ),
                        $summary,
@@ -69,10 +74,7 @@ class ApiRollback extends ApiBase {
                        $this->dieStatus( $this->errorArrayToStatus( $retval, $user ) );
                }
 
-               $watch = 'preferences';
-               if ( isset( $params['watchlist'] ) ) {
-                       $watch = $params['watchlist'];
-               }
+               $watch = $params['watchlist'] ?? 'preferences';
 
                // Watch pages
                $this->setWatch( $watch, $titleObj, 'watchrollback' );