mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 10:48:17 +00:00
Remove workaround to complete phase 1 of variables migration
When all the other patches will be merged, this workaround won't be necessary, and by removing it we're finishing the first phase of variables migration. Which could also be the only one if we decide not to go on and remove the old ones. Bug: T173889 Depends-On: I5c370b54e6516889624088e27928ad3a1f48a821 Depends-On: I6576497feaf6d2c475ee33a91feb6a640e2c20fe Depends-On: I87a48fdc8b392b25eb02807e8d0f712d0a399ece Depends-On: Ib29eb15c1a51c037d036be8dc1541d96ea4b174b Depends-On: I909a99e80a895a9b009c33ea72e8e0a4ea0a1375 Change-Id: If5f238cddb41ef92b141e36b4f2f15fd4cc86476
This commit is contained in:
parent
2fc56ce014
commit
217b4b57ff
|
@ -403,36 +403,19 @@ class AbuseFilter {
|
|||
/**
|
||||
* @param Title|null $title
|
||||
* @param string $prefix
|
||||
* @param bool $transition Temporary parameter to help with T173889 and to be removed afterwards
|
||||
* @return AbuseFilterVariableHolder
|
||||
*/
|
||||
public static function generateTitleVars( $title, $prefix, $transition = true ) {
|
||||
public static function generateTitleVars( $title, $prefix ) {
|
||||
$vars = new AbuseFilterVariableHolder;
|
||||
|
||||
if ( !$title ) {
|
||||
return $vars;
|
||||
}
|
||||
|
||||
// Temporary overrides for T173889, necessary because Flow (and maybe
|
||||
// other extensions) still pass old prefix/suffix and thus fail, since
|
||||
// hybrid variables are generated (e.g. article_prefixedtitle).
|
||||
// Once their variables will be renamed according to the new syntax,
|
||||
// we should get rid of these if and just use the new prefix/suffix.
|
||||
// Right now, what we want to do is:
|
||||
// - Use new prefix/suffix for AF's own variables (they're handled at parser level)
|
||||
// - Use old prefix/suffix for external variables (we don't handle them)
|
||||
$titleSuffix = 'TITLE';
|
||||
if ( $transition && $prefix === 'BOARD' ) {
|
||||
$titleSuffix = 'TEXT';
|
||||
}
|
||||
if ( $transition && $prefix === 'ARTICLE' ) {
|
||||
$prefix = 'PAGE';
|
||||
}
|
||||
|
||||
$vars->setVar( $prefix . '_ID', $title->getArticleID() );
|
||||
$vars->setVar( $prefix . '_NAMESPACE', $title->getNamespace() );
|
||||
$vars->setVar( $prefix . "_$titleSuffix", $title->getText() );
|
||||
$vars->setVar( $prefix . "_PREFIXED$titleSuffix", $title->getPrefixedText() );
|
||||
$vars->setVar( $prefix . '_TITLE', $title->getText() );
|
||||
$vars->setVar( $prefix . '_PREFIXEDTITLE', $title->getPrefixedText() );
|
||||
|
||||
global $wgRestrictionTypes;
|
||||
foreach ( $wgRestrictionTypes as $action ) {
|
||||
|
|
Loading…
Reference in a new issue