Merge "Improve "selfmove" message's wording"
[lhc/web/wiklou.git] / includes / actions / HistoryAction.php
index d1be7d4..fe84852 100644 (file)
@@ -192,27 +192,26 @@ class HistoryAction extends FormlessAction {
 
                // Add the general form
                $action = htmlspecialchars( wfScript() );
+               $content = Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n";
+               $content .= Html::hidden( 'action', 'history' ) . "\n";
+               $content .= Xml::dateMenu(
+                       ( $year == null ? MWTimestamp::getLocalInstance()->format( 'Y' ) : $year ),
+                       $month
+               ) . ' ';
+               $content .= $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '';
+               $content .= $checkDeleted . Html::submitButton(
+                       $this->msg( 'historyaction-submit' )->text(),
+                       [],
+                       [ 'mw-ui-progressive' ]
+               );
                $out->addHTML(
                        "<form action=\"$action\" method=\"get\" id=\"mw-history-searchform\">" .
                        Xml::fieldset(
                                $this->msg( 'history-fieldset-title' )->text(),
-                               false,
+                               $content,
                                [ 'id' => 'mw-history-search' ]
                        ) .
-                       Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
-                       Html::hidden( 'action', 'history' ) . "\n" .
-                       Xml::dateMenu(
-                               ( $year == null ? MWTimestamp::getLocalInstance()->format( 'Y' ) : $year ),
-                               $month
-                       ) . '&#160;' .
-                       ( $tagSelector ? ( implode( '&#160;', $tagSelector ) . '&#160;' ) : '' ) .
-                       $checkDeleted .
-                       Html::submitButton(
-                               $this->msg( 'historyaction-submit' )->text(),
-                               [],
-                               [ 'mw-ui-progressive' ]
-                       ) . "\n" .
-                       '</fieldset></form>'
+                       '</form>'
                );
 
                Hooks::run( 'PageHistoryBeforeList', [ &$this->page, $this->getContext() ] );
@@ -780,9 +779,11 @@ class HistoryPager extends ReverseChronologicalPager {
                        $s .= ' <span class="mw-changeslist-separator">. .</span> ' . $s2;
                }
 
-               Hooks::run( 'PageHistoryLineEnding', [ $this, &$row, &$s, &$classes ] );
+               $attribs = [ 'data-mw-revid' => $rev->getId() ];
+
+               Hooks::run( 'PageHistoryLineEnding', [ $this, &$row, &$s, &$classes, &$attribs ] );
+               $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] );
 
-               $attribs = [];
                if ( $classes ) {
                        $attribs['class'] = implode( ' ', $classes );
                }