From 56f8bde0fc6d3d050653980f49eed7ed7a1fa5b4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 9 May 2016 22:12:38 -0700 Subject: [PATCH] Avoid master queries on GET in ProtectionForm Bug: T92357 Change-Id: I58c5e793164faaafeea45ec5e986edcc7537ccab --- includes/ProtectionForm.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 70192b9c2b..451635e319 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -70,7 +70,9 @@ class ProtectionForm { // Check if the form should be disabled. // If it is, the form will be available in read-only to show levels. $this->mPermErrors = $this->mTitle->getUserPermissionsErrors( - 'protect', $this->mContext->getUser() + 'protect', + $this->mContext->getUser(), + $this->mContext->getRequest()->wasPosted() ? 'secure' : 'full' // T92357 ); if ( wfReadOnly() ) { $this->mPermErrors[] = [ 'readonlytext', wfReadOnlyReason() ]; -- 2.20.1