X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=blobdiff_plain;f=includes%2FMediaWiki.php;h=43512e122367010d42649cd6f8ae7438935a7002;hb=694fef93eaab44609c35598c1740a098c18c2320;hp=f5a954dc8d6f81e6de011db0415f860f2807979a;hpb=0770f85a0a293e6c7af6f1d3d3a1dbd2d13c1e09;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index f5a954dc8d..43512e1223 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -569,8 +569,11 @@ class MediaWiki { } /** - * This function commits all DB changes as needed before - * the user can receive a response (in case commit fails) + * This function commits all DB and session changes as needed *before* the + * client can receive a response (in case DB commit fails) and thus also before + * the response can trigger a subsequent related request by the client + * + * If there is a significant amount of content to flush, it can be done in $postCommitWork * * @param IContextSource $context * @param callable|null $postCommitWork [default: null] @@ -598,6 +601,8 @@ class MediaWiki { // Run updates that need to block the user or affect output (this is the last chance) DeferredUpdates::doUpdates( 'enqueue', DeferredUpdates::PRESEND ); wfDebug( __METHOD__ . ': pre-send deferred updates completed' ); + // T214471: persist the session to avoid race conditions on subsequent requests + $request->getSession()->save(); // Should the client return, their request should observe the new ChronologyProtector // DB positions. This request might be on a foreign wiki domain, so synchronously update