Page MenuHomePhabricator

Reconsider interface of FilterStore and MutableFilter
Open, Needs TriagePublic

Description

From https://gerrit.wikimedia.org/r/c/mediawiki/extensions/AbuseFilter/+/1183259 (T395323):

In fact, MutableFilter probably doesn't even need to hold LastEditInfo because the data is always written directly to the database in FilterStore and the underlying LastEditInfo is actually never used. (Technically, LastEditInfo shouldn't be mutable because it is the information about the last edit which never changes.)

A leftover from T396636:

includes/FilterStore.php
// If the filter is already protected, it must remain protected even if
// the current filter doesn't use a protected variable anymore
// FIXME: Resposibility for this is currently unclear. It should be
// enforced prior to the FilterCompare::compareVersions call to avoid
// dummy filter versions.
$privacyLevel = $filter->getPrivacyLevel();
if ( $originalFilter->isProtected() ) {
	$privacyLevel |= Flags::FILTER_USES_PROTECTED_VARS;
}