mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 14:13:54 +00:00
Merge "Remove AbuseFilter::getFilter"
This commit is contained in:
commit
b6b90c07cb
|
@ -268,17 +268,6 @@ class AbuseFilter {
|
|||
return $runner->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 1.36 Use FilterLookup
|
||||
* @param string $filter Filter ID (integer or "<GLOBAL_FILTER_PREFIX><integer>")
|
||||
* @return stdClass DB row
|
||||
*/
|
||||
public static function getFilter( $filter ) {
|
||||
[ $filterID, $global ] = self::splitGlobalName( $filter );
|
||||
$lookup = AbuseFilterServices::getFilterLookup();
|
||||
return $lookup->getFilter( $filterID, $global )->toDatabaseRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a var dump to External Storage or the text table
|
||||
* Some of this code is stolen from Revision::insertOn and friends
|
||||
|
|
|
@ -159,7 +159,8 @@ class AbuseFilterViewExamine extends AbuseFilterView {
|
|||
return;
|
||||
}
|
||||
|
||||
$isHidden = AbuseFilter::getFilter( $row->afl_filter )->af_hidden;
|
||||
[ $filterID, $isGlobal ] = AbuseFilter::splitGlobalName( $row->afl_filter );
|
||||
$isHidden = AbuseFilterServices::getFilterLookup()->getFilter( $filterID, $isGlobal )->isHidden();
|
||||
if ( !$afPermManager->canSeeLogDetailsForFilter( $user, $isHidden ) ) {
|
||||
$out->addWikiMsg( 'abusefilter-log-cannot-see-details' );
|
||||
return;
|
||||
|
|
|
@ -186,7 +186,7 @@ class ApiQueryAbuseLog extends ApiQueryBase {
|
|||
}
|
||||
}
|
||||
list( $filterID, $global ) = AbuseFilter::splitGlobalName( $row->afl_filter );
|
||||
$isHidden = AbuseFilter::getFilter( $row->afl_filter )->af_hidden;
|
||||
$isHidden = $lookup->getFilter( $filterID, $global )->isHidden();
|
||||
$canSeeDetails = $afPermManager->canSeeLogDetailsForFilter( $user, $isHidden );
|
||||
|
||||
$entry = [];
|
||||
|
|
|
@ -678,9 +678,9 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
|
|||
if ( !$row ) {
|
||||
$error = 'abusefilter-log-nonexistent';
|
||||
} else {
|
||||
list( , $global ) = AbuseFilter::splitGlobalName( $row->afl_filter );
|
||||
list( $filterID, $global ) = AbuseFilter::splitGlobalName( $row->afl_filter );
|
||||
if ( $global ) {
|
||||
$filter_hidden = AbuseFilter::getFilter( $row->afl_filter )->af_hidden;
|
||||
$filter_hidden = AbuseFilterServices::getFilterLookup()->getFilter( $filterID, $global )->isHidden();
|
||||
} else {
|
||||
$filter_hidden = $row->af_hidden;
|
||||
}
|
||||
|
@ -840,9 +840,10 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
|
|||
return $status;
|
||||
}
|
||||
|
||||
list( , $global ) = AbuseFilter::splitGlobalName( $row->afl_filter );
|
||||
list( $filterID, $global ) = AbuseFilter::splitGlobalName( $row->afl_filter );
|
||||
if ( $global ) {
|
||||
$filterHidden = AbuseFilter::getFilter( $row->afl_filter )->af_hidden;
|
||||
$lookup = AbuseFilterServices::getFilterLookup();
|
||||
$filterHidden = $lookup->getFilter( $filterID, $global )->isHidden();
|
||||
} else {
|
||||
$filterHidden = $row->af_hidden;
|
||||
}
|
||||
|
@ -1184,7 +1185,7 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
|
|||
} catch ( CentralDBNotAvailableException $_ ) {
|
||||
$escaped_comments = $this->msg( 'abusefilter-log-description-not-available' )->escaped();
|
||||
}
|
||||
$filter_hidden = AbuseFilter::getFilter( $row->afl_filter )->af_hidden;
|
||||
$filter_hidden = $lookup->getFilter( $filterID, $global )->isHidden();
|
||||
} else {
|
||||
$escaped_comments = Sanitizer::escapeHtmlAllowEntities(
|
||||
$row->af_public_comments );
|
||||
|
|
Loading…
Reference in a new issue