r107451 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107450‎ | r107451 | r107452 >
Date:23:35, 27 December 2011
Author:mah
Status:ok
Tags:
Comment:
Fix Bug 33390 - Examine page is visible for hidden log entries
Fix Bug 24186 - "Examine" page is visible to users without abusefilter-log-detail right
Author: Nikola Kovacs

There was a more complex patch on Bug 24186, but I think he makes a
good argument why his is better.

Beware: I'm not set up to test AbuseFilter, but I didn't see anyone
else in core MW who regularly works on it.
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.i18n.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewExamine.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewExamine.php
@@ -106,6 +106,16 @@
107107 self::$examineType = 'log';
108108 self::$examineId = $logid;
109109
 110+ if ( !SpecialAbuseLog::canSeeDetails() ) {
 111+ $this->getOutput()->addWikiMsg( 'abusefilter-log-cannot-see-details' );
 112+ return;
 113+ }
 114+
 115+ if ( $row->afl_deleted && !SpecialAbuseLog::canSeeHidden() ) {
 116+ $this->getOutput()->addWikiMsg( 'abusefilter-log-details-hidden' );
 117+ return;
 118+ }
 119+
110120 $vars = AbuseFilter::loadVarDump( $row->afl_var_dump );
111121
112122 $this->showExaminer( $vars );
Index: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php
@@ -104,6 +104,7 @@
105105 'abusefilter-log-linkoncontribs-text' => 'Abuse log for this user',
106106 'abusefilter-log-hidden' => '(entry hidden)',
107107 'abusefilter-log-hide' => 'hide or unhide', // @todo FIXME: Message unused?
 108+ 'abusefilter-log-cannot-see-details' => 'You do not have permission to see details of any entries.',
108109 'abusefilter-log-details-hidden' => 'You cannot view the details for this entry because it is hidden from public view.',
109110
110111 // Hiding log entries
@@ -580,6 +581,7 @@
581582 'abusefilter-log-linkoncontribs-text' => 'Title for link added on [[Special:Contributions]] and other relevant special pages.',
582583 'abusefilter-log-hidden' => 'Text for a hidden log entry.',
583584 'abusefilter-log-hide' => 'This message may be unused.',
 585+ 'abusefilter-log-cannot-see-details' => 'Message show instead of the log row for users without permissions to see any details.',
584586 'abusefilter-log-details-hidden' => 'Message shown instead of log row details when those are hidden.',
585587 'abusefilter-log-hide-legend' => 'Legend for form to hide a log entry.',
586588 'abusefilter-log-hide-id' => 'Field label in form to hide a log entry.',

Follow-up revisions

RevisionCommit summaryAuthorDate
r107454Fix Bug 33380 - Details of actions caught by a private filter should be private...mah00:26, 28 December 2011
r107455r107451 - Add message to special pagemah00:37, 28 December 2011

Status & tagging log