From: Aaron Schulz Date: Thu, 27 Aug 2015 00:54:58 +0000 (-0700) Subject: Defer spreadAnyEditBlock() post-send X-Git-Tag: 1.31.0-rc.0~10254^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=f336e583c9e4a6e3617a4ed5960540764134133e;p=lhc%2Fweb%2Fwiklou.git Defer spreadAnyEditBlock() post-send * No need for these to be perfectly synchronous Bug: T92357 Change-Id: I6863960c8170ef4c3f2e356841b4086ac98f0f03 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index f3a41c46b9..85a30147f3 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -527,7 +527,10 @@ class EditPage { if ( $permErrors ) { wfDebug( __METHOD__ . ": User can't edit\n" ); // Auto-block user's IP if the account was "hard" blocked - $wgUser->spreadAnyEditBlock(); + $user = $wgUser; + DeferredUpdates::addCallableUpdate( function() use ( $user ) { + $user->spreadAnyEditBlock(); + } ); $this->displayPermissionsError( $permErrors ); diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index e77479f32a..eb8a274e8c 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -104,7 +104,9 @@ class MovePageForm extends UnlistedSpecialPage { $permErrors = $this->oldTitle->getUserPermissionsErrors( 'move', $user ); if ( count( $permErrors ) ) { // Auto-block user's IP if the account was "hard" blocked - $user->spreadAnyEditBlock(); + DeferredUpdates::addCallableUpdate( function() use ( $user ) { + $user->spreadAnyEditBlock(); + } ); throw new PermissionsError( 'move', $permErrors ); }