From: Nikerabbit Date: Thu, 21 Dec 2017 07:27:17 +0000 (+0000) Subject: Merge "Add tags for undo edits" X-Git-Tag: 1.31.0-rc.0~1149 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=08edb27f6ce31c676660a4ef89b87da79bde2cc2;hp=a84faa932f5a7b985b5c34e252918fc15d840ebe Merge "Add tags for undo edits" --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 2bad0db0b2..b707174ced 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -6953,6 +6953,7 @@ $wgUseTagFilter = true; * - 'mw-blank': Edit completely blanks the page * - 'mw-replace': Edit removes more than 90% of the content * - 'mw-rollback': Edit is a rollback, made through the rollback link or rollback API + * - 'mw-undo': Edit made through an undo link * * @var array * @since 1.31 @@ -6964,7 +6965,8 @@ $wgSoftwareTags = [ 'mw-changed-redirect-target' => true, 'mw-blank' => true, 'mw-replace' => true, - 'mw-rollback' => true + 'mw-rollback' => true, + 'mw-undo' => true, ]; /** diff --git a/includes/changetags/ChangeTags.php b/includes/changetags/ChangeTags.php index b4a8ca8028..db1f599087 100644 --- a/includes/changetags/ChangeTags.php +++ b/includes/changetags/ChangeTags.php @@ -39,7 +39,8 @@ class ChangeTags { 'mw-changed-redirect-target', 'mw-blank', 'mw-replace', - 'mw-rollback' + 'mw-rollback', + 'mw-undo', ]; /** diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index ac9cd84403..b411855aec 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1624,6 +1624,11 @@ class WikiPage implements Page, IDBAccessObject { $tags[] = $tag; } + // Check for undo tag + if ( $undidRevId !== 0 && in_array( 'mw-undo', ChangeTags::getSoftwareTags() ) ) { + $tags[] = 'mw-undo'; + } + // Provide autosummaries if summary is not provided and autosummaries are enabled if ( $wgUseAutomaticEditSummaries && ( $flags & EDIT_AUTOSUMMARY ) && $summary == '' ) { $summary = $handler->getAutosummary( $old_content, $content, $flags ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 3a679826cd..301408fca8 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -3891,6 +3891,8 @@ "tag-mw-replace-description": "Edits that remove more than 90% of the content of a page", "tag-mw-rollback": "Rollback", "tag-mw-rollback-description": "Edits that roll back previous edits using the rollback link", + "tag-mw-undo": "Undo", + "tag-mw-undo-description": "Edits that undo previous edits using the undo link", "tags-title": "Tags", "tags-intro": "This page lists the tags that the software may mark an edit with, and their meaning.", "tags-tag": "Tag name", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index c3ee69c8ef..0659453915 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -4086,6 +4086,8 @@ "tag-mw-replace-description": "Description for \"replace\" change tag", "tag-mw-rollback": "Change tag for rolling back an edit\n{{Identical|Rollback}}", "tag-mw-rollback-description": "Description for \"rollback\" change tag", + "tag-mw-undo": "Change tag for undoing an edit", + "tag-mw-undo-description": "Description for \"undo\" change tag", "tags-title": "The title of [[Special:Tags]].\n{{Identical|Tag}}", "tags-intro": "Explanation on top of [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]].", "tags-tag": "Caption of a column in [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]].",