Add tags for undo edits
[lhc/web/wiklou.git] / includes / page / WikiPage.php
index 9df3d8c..67e4d0d 100644 (file)
@@ -1305,7 +1305,7 @@ class WikiPage implements Page, IDBAccessObject {
         * Add row to the redirect table if this is a redirect, remove otherwise.
         *
         * @param IDatabase $dbw
-        * @param Title $redirectTitle Title object pointing to the redirect target,
+        * @param Title|null $redirectTitle Title object pointing to the redirect target,
         *   or NULL if this is not a redirect
         * @param null|bool $lastRevIsRedirect If given, will optimize adding and
         *   removing rows in redirect table.
@@ -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 );