Add missing & to @param documentation to match functon call
[lhc/web/wiklou.git] / includes / changes / OldChangesList.php
index a5d5191..4c4fb7e 100644 (file)
@@ -25,14 +25,13 @@ class OldChangesList extends ChangesList {
        /**
         * Format a line using the old system (aka without any javascript).
         *
-        * @param RecentChange $rc Passed by reference
+        * @param RecentChange &$rc Passed by reference
         * @param bool $watched (default false)
         * @param int $linenumber (default null)
         *
         * @return string|bool
         */
        public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
-
                $classes = $this->getHTMLClasses( $rc, $watched );
                // use mw-line-even/mw-line-odd class only if linenumber is given (feature from T16468)
                if ( $linenumber ) {
@@ -50,16 +49,23 @@ class OldChangesList extends ChangesList {
                                $rc->mAttribs['rc_namespace'] . '-' . $rc->mAttribs['rc_title'] );
                }
 
+               $attribs = $this->getDataAttributes( $rc );
+
                // Avoid PHP 7.1 warning from passing $this by reference
                $list = $this;
-               if ( !Hooks::run( 'OldChangesListRecentChangesLine', [ &$list, &$html, $rc, &$classes ] ) ) {
+               if ( !Hooks::run( 'OldChangesListRecentChangesLine',
+                       [ &$list, &$html, $rc, &$classes, &$attribs ] )
+               ) {
                        return false;
                }
+               $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] );
 
                $dateheader = ''; // $html now contains only <li>...</li>, for hooks' convenience.
                $this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] );
 
-               return "$dateheader<li class=\"" . implode( ' ', $classes ) . "\">" . $html . "</li>\n";
+               $attribs['class'] = implode( ' ', $classes );
+
+               return $dateheader . Html::rawElement( 'li', $attribs,  $html ) . "\n";
        }
 
        /**