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
This commit is contained in:
Daimona Eaytoy 2018-08-19 18:22:07 +02:00
parent 01df24418a
commit 9d21c7d03d
2 changed files with 8 additions and 2 deletions

View file

@ -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;
}

View file

@ -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;
}
/**