We push 'class' in the attribute array so the hook
can manipulate it, so it needs to be added to the attribute
whitelist as well.
Broken in I6dd006d0b1b0fd35c0020f0f9eea9113eca30b35.
Bug: T167922
Bug: T167535
Change-Id: Ic24400382a9dcbb990e12dfddae4ab7db14553cc
}
$attribs = $data['attribs'];
unset( $data['attribs'] );
- $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] );
+ $attribs = wfArrayFilterByKey( $attribs, function( $key ) {
+ return $key === 'class' || Sanitizer::isReservedDataAttribute( $key );
+ } );
$line = Html::openElement( 'table', $attribs ) . Html::openElement( 'tr' );
$line .= '<td class="mw-enhanced-rc"><span class="mw-enhancedchanges-arrow-space"></span>';
$enhancedChangesList->recentChangesLine( $recentChange, false );
$html = $enhancedChangesList->endRecentChangesList();
- $this->assertContains( 'data-mw-revid="5"', $html );
+ $this->assertRegExp( '/data-mw-revid="5" class="[^"]*mw-enhanced-rc[^"]*"/', $html );
$recentChange2 = $this->getEditChange( '20131103092253' );
$enhancedChangesList->recentChangesLine( $recentChange2, false );