Merge "Allow $wgResourceModuleSkinStyles for any ResourceLoaderFileModule subclass"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 21 Jun 2017 19:53:24 +0000 (19:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 21 Jun 2017 19:53:24 +0000 (19:53 +0000)
includes/changes/EnhancedChangesList.php
includes/title/MalformedTitleException.php
tests/phpunit/includes/changes/EnhancedChangesListTest.php

index 2d50f76..cbbbfeb 100644 (file)
@@ -685,7 +685,9 @@ class EnhancedChangesList extends ChangesList {
                }
                $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>';
index 2dddac5..213343f 100644 (file)
@@ -34,7 +34,7 @@ class MalformedTitleException extends Exception implements ILocalizedException {
         * $titleText will be appended if it's not null. (since MW 1.26)
         */
        public function __construct(
-               $errorMessage = null, $titleText = null, $errorMessageParameters = []
+               $errorMessage, $titleText = null, $errorMessageParameters = []
        ) {
                $this->errorMessage = $errorMessage;
                $this->titleText = $titleText;
@@ -59,7 +59,7 @@ class MalformedTitleException extends Exception implements ILocalizedException {
 
        /**
         * @since 1.26
-        * @return string|null
+        * @return string
         */
        public function getErrorMessage() {
                return $this->errorMessage;
index 029d1fe..28818d9 100644 (file)
@@ -99,7 +99,7 @@ class EnhancedChangesListTest extends MediaWikiLangTestCase {
                $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 );