mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Merge "Add new variable article_first_contributor"
This commit is contained in:
commit
ff8dc48d2e
|
@ -123,6 +123,7 @@ class AbuseFilter {
|
|||
'article_restrictions_create' => 'restrictions-create',
|
||||
'article_restrictions_upload' => 'restrictions-upload',
|
||||
'article_recent_contributors' => 'recent-contributors',
|
||||
'article_first_contributor' => 'first-contributor',
|
||||
# 'old_text' => 'old-text-stripped', # Disabled, performance
|
||||
# 'old_html' => 'old-html', # Disabled, performance
|
||||
'old_links' => 'old-links',
|
||||
|
@ -342,6 +343,12 @@ class AbuseFilter {
|
|||
'namespace' => $title->getNamespace()
|
||||
) );
|
||||
|
||||
$vars->setLazyLoadVar( "{$prefix}_first_contributor", 'load-first-author',
|
||||
array(
|
||||
'title' => $title->getText(),
|
||||
'namespace' => $title->getNamespace()
|
||||
) );
|
||||
|
||||
wfRunHooks( 'AbuseFilter-generateTitleVars', array( $vars, $title, $prefix ) );
|
||||
|
||||
return $vars;
|
||||
|
|
|
@ -503,6 +503,17 @@ class AFComputedVariable {
|
|||
$users[] = $row->rev_user_text;
|
||||
}
|
||||
$result = $users;
|
||||
break;
|
||||
case 'load-first-author':
|
||||
$title = Title::makeTitle( $parameters['namespace'], $parameters['title'] );
|
||||
|
||||
$revision = $title->getFirstRevision();
|
||||
if ( $revision ) {
|
||||
$result = $revision->getUserText();
|
||||
} else {
|
||||
$result = '';
|
||||
}
|
||||
|
||||
break;
|
||||
case 'get-page-restrictions':
|
||||
$action = $parameters['action'];
|
||||
|
|
|
@ -264,6 +264,7 @@
|
|||
"abusefilter-edit-builder-vars-user-blocked": "Whether user is blocked",
|
||||
"abusefilter-edit-builder-vars-user-emailconfirm": "Time email address was confirmed",
|
||||
"abusefilter-edit-builder-vars-recent-contributors": "Last ten users to contribute to the page",
|
||||
"abusefilter-edit-builder-vars-first-contributor": "First user to contribute to the page",
|
||||
"abusefilter-edit-builder-vars-all-links": "All external links in the new text",
|
||||
"abusefilter-edit-builder-vars-added-links": "All external links added in the edit",
|
||||
"abusefilter-edit-builder-vars-removed-links": "All external links removed in the edit",
|
||||
|
@ -394,4 +395,4 @@
|
|||
"abusefilter-import-submit": "Import data",
|
||||
"abusefilter-group-default": "Default",
|
||||
"abusefilter-http-error": "An HTTP error occurred: $1."
|
||||
}
|
||||
}
|
||||
|
|
|
@ -285,6 +285,7 @@
|
|||
"abusefilter-edit-builder-vars-user-groups": "See also:\n* {{msg-mw|Abusefilter-edit-builder-vars-global-user-groups}}",
|
||||
"abusefilter-edit-builder-vars-user-rights": "Paraphrased: List of rights that the user has. Abuse filter syntax option in a dropdown from the group {{msg-mw|abusefilter-edit-builder-group-vars}}.",
|
||||
"abusefilter-edit-builder-vars-user-blocked": "Paraphrased: Boolean value on whether the user is blocked. Abuse filter syntax option in a dropdown from the group {{msg-mw|abusefilter-edit-builder-group-vars}}.",
|
||||
"abusefilter-edit-builder-vars-first-contributor": "Paraphrased: The user who created the earliest revision of the page. Abuse filter syntax option in a dropdown from the group {{msg-mw|abusefilter-edit-builder-group-vars}}.",
|
||||
"abusefilter-edit-builder-vars-new-pst": "Paraphrased: The output wikitext after pre-save transform is applied to new_wikitext. Abuse filter syntax option in a dropdown from the group {{msg-mw|abusefilter-edit-builder-group-vars}}.",
|
||||
"abusefilter-edit-builder-vars-diff-pst": "Paraphrased: Edit diff of new_pst against old_wikitext. Abuse filter syntax option in a dropdown from the group {{msg-mw|abusefilter-edit-builder-group-vars}}.",
|
||||
"abusefilter-edit-builder-vars-addedlines-pst": "Paraphrased: Added lines in edit_diff_pst. Abuse filter syntax option in a dropdown from the group {{msg-mw|abusefilter-edit-builder-group-vars}}.",
|
||||
|
|
Loading…
Reference in a new issue