Merge "Really disable the minor_edit variable"

This commit is contained in:
jenkins-bot 2018-12-31 02:21:56 +00:00 committed by Gerrit Code Review
commit e6ca0f288d
4 changed files with 6 additions and 9 deletions

View file

@ -381,7 +381,7 @@
"abusefilter-edit-builder-vars-old-text-stripped": "Old page text, stripped of any markup",
"abusefilter-edit-builder-vars-old-links": "Links in the page, before the edit",
"abusefilter-edit-builder-vars-old-html": "Old page wikitext, parsed into HTML (no more in use)",
"abusefilter-edit-builder-vars-minor-edit": "Whether or not the edit is marked as minor",
"abusefilter-edit-builder-vars-minor-edit": "Whether or not the edit is marked as minor (no more in use)",
"abusefilter-edit-builder-vars-file-sha1": "SHA1 hash of file contents",
"abusefilter-edit-builder-vars-file-size": "Size of the file in bytes",
"abusefilter-edit-builder-vars-file-mime": "MIME type of the file",

View file

@ -161,7 +161,6 @@ class AbuseFilter {
'moved_to_recent_contributors' => 'movedto-recent-contributors',
'moved_to_first_contributor' => 'movedto-first-contributor',
'old_links' => 'old-links',
'minor_edit' => 'minor-edit',
'file_sha1' => 'file-sha1',
'file_size' => 'file-size',
'file_mime' => 'file-mime',
@ -175,7 +174,8 @@ class AbuseFilter {
/** @var array Old vars which aren't in use anymore */
public static $disabledVars = [
'old_text' => 'old-text-stripped',
'old_html' => 'old-html'
'old_html' => 'old-html',
'minor_edit' => 'minor-edit'
];
public static $deprecatedVars = [

View file

@ -822,7 +822,6 @@ class AbuseFilterHooks {
// Load vars for filters to check
$vars->setVar( 'summary', $summary );
$vars->setVar( 'minor_edit', false );
$vars->setVar( 'old_wikitext', $oldtext );
$vars->setVar( 'new_wikitext', $text );
// TODO: set old_content and new_content vars, use them

View file

@ -13,11 +13,6 @@ class AbuseFilterVariableHolder {
*/
public $mVarsVersion = 2;
public function __construct() {
// Backwards-compatibility (unused now)
$this->setVar( 'minor_edit', false );
}
/**
* @param string $variable
* @param mixed $datum
@ -63,6 +58,9 @@ class AbuseFilterVariableHolder {
} elseif ( $this->mVars[$variable] instanceof AFPData ) {
return $this->mVars[$variable];
}
} elseif ( array_key_exists( $variable, AbuseFilter::$disabledVars ) ) {
wfWarn( "Disabled variable $variable requested. Please fix the filter as this will " .
"be removed soon." );
}
return new AFPData();
}