Page MenuHomePhabricator

01-T413139.patch

Authored By
STran
Dec 19 2025, 8:03 AM
Size
1 KB
Referenced Files
None
Subscribers
None

01-T413139.patch

From 387f936c134ded47bdeb72aab46d8bbc4ce272ad Mon Sep 17 00:00:00 2001
From: STran <stran@wikimedia.org>
Date: Fri, 19 Dec 2025 00:01:01 -0800
Subject: [PATCH] SECURTIY: Only show temp accounts on IP if temp accounts are
known
Why:
The function will fail fatally otherwise as it cannot count an unknown thing
What:
- Check `isKnown` before proceeding with shouldShowCountFromThisIP
Bug: T413139
Change-Id: I0cc87247ad08f7aebfde40924fffc49aeb902afc
---
.../SpecialContributionsBeforeMainOutputHandler.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/HookHandler/SpecialContributionsBeforeMainOutputHandler.php b/src/HookHandler/SpecialContributionsBeforeMainOutputHandler.php
index 8da632f7..203eaed6 100644
--- a/src/HookHandler/SpecialContributionsBeforeMainOutputHandler.php
+++ b/src/HookHandler/SpecialContributionsBeforeMainOutputHandler.php
@@ -56,7 +56,11 @@ class SpecialContributionsBeforeMainOutputHandler implements SpecialContribution
}
private function shouldShowCountFromThisIP( UserIdentity $user, ContributionsSpecialPage $sp ): bool {
- if ( $user->isRegistered() || !$this->isValidIPOrQueryableRange( $user->getName(), $sp->getConfig() ) ) {
+ if (
+ !$this->tempUserConfig->isKnown() ||
+ $user->isRegistered() ||
+ !$this->isValidIPOrQueryableRange( $user->getName(), $sp->getConfig() )
+ ) {
return false;
}
--
2.48.1

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
22759117
Default Alt Text
01-T413139.patch (1 KB)

Event Timeline