Make global AbuseFilters searchable on Special:AbuseLog

Global AbuseFilters will be searchable using "global-123"
with this. Furthermore this patch fixes the visibility of
global AbuseFilter ids within the API module.

Bug: 51007
Change-Id: Ia6caba5ae3d727b778076ecdba500b4dc1d55b6f
This commit is contained in:
Marius Hoch 2013-07-10 00:49:19 +02:00 committed by Hashar
parent 2fcb9e51df
commit d2a342788f
2 changed files with 7 additions and 6 deletions

View file

@ -159,8 +159,11 @@ class ApiQueryAbuseLog extends ApiQueryBase {
if ( $fld_ids ) {
$entry['id'] = intval( $row->afl_id );
$entry['filter_id'] = '';
if ( !AbuseFilter::filterHidden( $row->afl_filter ) || SpecialAbuseLog::canSeeHidden() ) {
$entry['filter_id'] = intval( $row->afl_filter );
if ( !AbuseFilter::filterHidden( $row->afl_filter )
|| AbuseFilterView::canViewPrivate()
|| $this->getUser()->isAllowed( 'abusefilter-log-private' )
) {
$entry['filter_id'] = $row->afl_filter;
}
}
if ( $fld_filter ) {

View file

@ -88,7 +88,7 @@ class SpecialAbuseLog extends SpecialPage {
$this->mSearchTitle = $request->getText( 'wpSearchTitle' );
$this->mSearchFilter = null;
if ( self::canSeeDetails() ) {
$this->mSearchFilter = $request->getIntOrNull( 'wpSearchFilter' );
$this->mSearchFilter = $request->getText( 'wpSearchFilter' );
}
}
@ -288,9 +288,7 @@ class SpecialAbuseLog extends SpecialPage {
return;
}
$output = '';
$output .= Xml::element(
$output = Xml::element(
'legend',
null,
$this->msg( 'abusefilter-log-details-legend', $id )->text()