jenkins-bot has submitted this change and it was merged.
Change subject: Do not show user blocked warning on included
Special:Contributions page
......................................................................
Do not show user blocked warning on included Special:Contributions page
When user included {{Special:Contributions}} page of blocked user,
do not show "this user is blocked" box.
Bug: 65781
Change-Id: I13b80f829dd26bf960b16efea588618c36898a5d
---
M RELEASE-NOTES-1.24
M includes/specials/SpecialContributions.php
2 files changed, 26 insertions(+), 23 deletions(-)
Approvals:
IAlex: Looks good to me, approved
jenkins-bot: Verified
diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24
index 2f41347..8e95222 100644
--- a/RELEASE-NOTES-1.24
+++ b/RELEASE-NOTES-1.24
@@ -203,6 +203,7 @@
* BREAKING CHANGE: The undocumented Special{$this->getName()}BeforeFormDisplay
set of hooks has been removed and replaced by a single new hook
SpecialPageBeforeFormDisplay.
+* (bug 65781) Removed block warning on included {{Special:Contributions}}
==== Renamed classes ====
* CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
diff --git a/includes/specials/SpecialContributions.php
b/includes/specials/SpecialContributions.php
index a1e8d2b..05bbb5a 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -270,30 +270,32 @@
// Show a note if the user is blocked and display the
last block log entry.
// Do not expose the autoblocks, since that may lead to
a leak of accounts' IPs,
// and also this will display a totally irrelevant log
entry as a current block.
- $block = Block::newFromTarget( $userObj, $userObj );
- if ( !is_null( $block ) && $block->getType() !=
Block::TYPE_AUTO ) {
- if ( $block->getType() == Block::TYPE_RANGE ) {
- $nt = MWNamespace::getCanonicalName(
NS_USER ) . ':' . $block->getTarget();
- }
+ if ( !$this->including() ) {
+ $block = Block::newFromTarget( $userObj,
$userObj );
+ if ( !is_null( $block ) && $block->getType() !=
Block::TYPE_AUTO ) {
+ if ( $block->getType() ==
Block::TYPE_RANGE ) {
+ $nt =
MWNamespace::getCanonicalName( NS_USER ) . ':' . $block->getTarget();
+ }
- $out = $this->getOutput(); // showLogExtract()
wants first parameter by reference
- LogEventsList::showLogExtract(
- $out,
- 'block',
- $nt,
- '',
- array(
- 'lim' => 1,
- 'showIfEmpty' => false,
- 'msgKey' => array(
- $userObj->isAnon() ?
-
'sp-contributions-blocked-notice-anon' :
-
'sp-contributions-blocked-notice',
- $userObj->getName() #
Support GENDER in 'sp-contributions-blocked-notice'
- ),
- 'offset' => '' # don't use
WebRequest parameter offset
- )
- );
+ $out = $this->getOutput(); //
showLogExtract() wants first parameter by reference
+ LogEventsList::showLogExtract(
+ $out,
+ 'block',
+ $nt,
+ '',
+ array(
+ 'lim' => 1,
+ 'showIfEmpty' => false,
+ 'msgKey' => array(
+
$userObj->isAnon() ?
+
'sp-contributions-blocked-notice-anon' :
+
'sp-contributions-blocked-notice',
+
$userObj->getName() # Support GENDER in 'sp-contributions-blocked-notice'
+ ),
+ 'offset' => '' # don't
use WebRequest parameter offset
+ )
+ );
+ }
}
}
--
To view, visit https://gerrit.wikimedia.org/r/136308
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I13b80f829dd26bf960b16efea588618c36898a5d
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: devunt <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: PleaseStand <[email protected]>
Gerrit-Reviewer: Swalling <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits