From 9d21c7d03dafbac1aedb722917a06bb43952aa4c Mon Sep 17 00:00:00 2001 From: Daimona Eaytoy Date: Sun, 19 Aug 2018 18:22:07 +0200 Subject: [PATCH] Change priority order for messages in hidden abuselog entries Check if the entry is deleted first, since it's the strongest deletion here (oversight level). Bonus: don't use implicit conversion when checking the return value of SpecialAbuseLog::isHidden. Bug: T200644 Change-Id: Ie5c4575ad29fe3dcb85a26cc74f1c59207df2852 --- includes/Views/AbuseFilterViewExamine.php | 3 ++- includes/special/SpecialAbuseLog.php | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/Views/AbuseFilterViewExamine.php b/includes/Views/AbuseFilterViewExamine.php index 42fd62147..aec63b2ce 100644 --- a/includes/Views/AbuseFilterViewExamine.php +++ b/includes/Views/AbuseFilterViewExamine.php @@ -157,7 +157,8 @@ class AbuseFilterViewExamine extends AbuseFilterView { return; } - if ( SpecialAbuseLog::isHidden( $row ) && !$this->getUser()->isAllowed( 'deletedtext' ) ) { + if ( SpecialAbuseLog::isHidden( $row ) === 'implicit' && + !$this->getUser()->isAllowed( 'deletedtext' ) ) { $out->addWikiMsg( 'abusefilter-log-details-hidden-implicit' ); return; } diff --git a/includes/special/SpecialAbuseLog.php b/includes/special/SpecialAbuseLog.php index fa70523f0..0b372d059 100644 --- a/includes/special/SpecialAbuseLog.php +++ b/includes/special/SpecialAbuseLog.php @@ -1055,6 +1055,11 @@ class SpecialAbuseLog extends SpecialPage { * The string 'implicit' if it is hidden because the corresponding revision is hidden. */ public static function isHidden( $row ) { + // First, check if the entry is hidden. Since this is an oversight-level deletion, + // it's more important than the associated revision being deleted. + if ( $row->afl_deleted ) { + return true; + } if ( $row->afl_rev_id ) { $revision = Revision::newFromId( $row->afl_rev_id ); if ( $revision && $revision->getVisibility() != 0 ) { @@ -1062,7 +1067,7 @@ class SpecialAbuseLog extends SpecialPage { } } - return (bool)$row->afl_deleted; + return false; } /**