X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiRollback.php;h=7c313d5cb76dbe28ae1e655c7d56f002b1c9d024;hb=a10838acba3b0bc76d5fe28ecfd7a9be98ab01c8;hp=10ba4782b739e4298dd602c1a32d082f500aa052;hpb=954327b642fcf869aab7fa75dd58a82935f9d2e1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index 10ba4782b7..7c313d5cb7 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -56,11 +56,12 @@ class ApiRollback extends ApiBase { } // @TODO: remove this hack once rollback uses POST (T88044) + $fname = __METHOD__; $trxLimits = $this->getConfig()->get( 'TrxProfilerLimits' ); $trxProfiler = Profiler::instance()->getTransactionProfiler(); - $trxProfiler->setExpectations( $trxLimits['POST'], __METHOD__ ); - DeferredUpdates::addCallableUpdate( function () use ( $trxProfiler, $trxLimits ) { - $trxProfiler->setExpectations( $trxLimits['PostSend-POST'], __METHOD__ ); + $trxProfiler->redefineExpectations( $trxLimits['POST'], $fname ); + DeferredUpdates::addCallableUpdate( function () use ( $trxProfiler, $trxLimits, $fname ) { + $trxProfiler->redefineExpectations( $trxLimits['PostSend-POST'], $fname ); } ); $retval = $pageObj->doRollback( @@ -84,13 +85,13 @@ class ApiRollback extends ApiBase { $info = [ 'title' => $titleObj->getPrefixedText(), - 'pageid' => intval( $details['current']->getPage() ), + 'pageid' => (int)$details['current']->getPage(), 'summary' => $details['summary'], - 'revid' => intval( $details['newid'] ), + 'revid' => (int)$details['newid'], // The revision being reverted (previously the current revision of the page) - 'old_revid' => intval( $details['current']->getID() ), + 'old_revid' => (int)$details['current']->getID(), // The revision being restored (the last revision before revision(s) by the reverted user) - 'last_revid' => intval( $details['target']->getID() ) + 'last_revid' => (int)$details['target']->getID() ]; $this->getResult()->addValue( null, $this->getModuleName(), $info );