From 23bf104160b9b5d7a9423d1c7939cb9f374effea Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Fri, 13 Jul 2018 06:33:10 +0300 Subject: [PATCH] Don't throw E_NOTICEs about undefined properties Bug: T199494 Change-Id: Id24b9ece76ca0bedcaac29f1a6f5567af78658c1 (cherry picked from commit 83164669a140717797953f07baaf0b3239689017) --- RELEASE-NOTES-1.31 | 1 + maintenance/removeUnusedAccounts.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index ac452ff15d..0af2402cf1 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -21,6 +21,7 @@ THIS IS NOT A RELEASE YET * (T113042) Do not allow loading pages raw with a text/javascript MIME type if non-admins can edit the page. * (T194052) Updated wikimedia/base-convert from 1.0.1 to 2.0.0. +* (T199494) Fix notices in maintenance/removeUnusuedAccounts.php == MediaWiki 1.31.1 == diff --git a/maintenance/removeUnusedAccounts.php b/maintenance/removeUnusedAccounts.php index e066300c58..3fa30cbd39 100644 --- a/maintenance/removeUnusedAccounts.php +++ b/maintenance/removeUnusedAccounts.php @@ -75,12 +75,12 @@ class RemoveUnusedAccounts extends Maintenance { # group or if it's touched within the $touchedSeconds seconds. $instance = User::newFromId( $row->user_id ); if ( count( array_intersect( $instance->getEffectiveGroups(), $excludedGroups ) ) == 0 - && $this->isInactiveAccount( $row->user_id, $row->actor_id, true ) + && $this->isInactiveAccount( $row->user_id, $row->actor_id ?? null, true ) && wfTimestamp( TS_UNIX, $row->user_touched ) < wfTimestamp( TS_UNIX, time() - $touchedSeconds ) ) { # Inactive; print out the name and flag it $delUser[] = $row->user_id; - if ( $row->actor_id ) { + if ( isset( $row->actor_id ) && $row->actor_id ) { $delActor[] = $row->actor_id; } $this->output( $row->user_name . "\n" ); @@ -138,7 +138,7 @@ class RemoveUnusedAccounts extends Maintenance { * (No edits, no deleted edits, no log entries, no current/old uploads) * * @param int $id User's ID - * @param int $actor User's actor ID + * @param int|null $actor User's actor ID * @param bool $master Perform checking on the master * @return bool */ -- 2.20.1