From: csteipp Date: Wed, 8 Aug 2012 17:04:10 +0000 (-0700) Subject: (bug 35839) Check permisions for revdel blocks X-Git-Tag: 1.31.0-rc.0~22512^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22lang_raccourcis%22%2C%22module=%24nom_module%22%29%20.%20%22?a=commitdiff_plain;h=764716c641816516195255512a058d49918f6154;p=lhc%2Fweb%2Fwiklou.git (bug 35839) Check permisions for revdel blocks If a block includes the "Hide username" to revdel the username, check that the user has permission to 'hideuser' before showing the reason for the block. Other metadata about the block (expiration, limits) will still be visible to admins. Change-Id: I50a49ea6876b99a944d27f7c34910f0aa47556c3 --- diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index b6484ce4d8..504839a738 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -258,7 +258,13 @@ class SpecialBlock extends FormSpecialPage { $fields['DisableUTEdit']['default'] = $block->prevents( 'editownusertalk' ); } - $fields['Reason']['default'] = $block->mReason; + // If the username was hidden (ipb_deleted == 1), don't show the reason + // unless this user also has rights to hideuser: Bug 35839 + if ( !$block->mHideName || $this->getUser()->isAllowed( 'hideuser' ) ) { + $fields['Reason']['default'] = $block->mReason; + } else { + $fields['Reason']['default'] = ''; + } if( $this->getRequest()->wasPosted() ){ # Ok, so we got a POST submission asking us to reblock a user. So show the