From f336e583c9e4a6e3617a4ed5960540764134133e Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 26 Aug 2015 17:54:58 -0700 Subject: [PATCH] Defer spreadAnyEditBlock() post-send * No need for these to be perfectly synchronous Bug: T92357 Change-Id: I6863960c8170ef4c3f2e356841b4086ac98f0f03 --- includes/EditPage.php | 5 ++++- includes/specials/SpecialMovepage.php | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) 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 ); } -- 2.20.1