X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fchanges%2FEnhancedChangesList.php;h=51a26baab72ceea63bc8b522412af567cea78078;hb=2f9a6581b75ca75e5b63c9a2d8a74d7ce62d9629;hp=ada02ce081460d27e72ec85103454551bbf95659;hpb=3081d93f0cd8f3d76223139037e44c3d2de9d7aa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index ada02ce081..51a26baab7 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -77,12 +77,12 @@ class EnhancedChangesList extends ChangesList { $this->lastdate = ''; $this->rclistOpen = false; $this->getOutput()->addModuleStyles( [ + 'mediawiki.icon', 'mediawiki.special.changeslist', 'mediawiki.special.changeslist.enhanced', ] ); $this->getOutput()->addModules( [ 'jquery.makeCollapsible', - 'mediawiki.icon', ] ); return '
'; @@ -93,7 +93,7 @@ class EnhancedChangesList extends ChangesList { * * @param RecentChange &$rc * @param bool $watched - * @param int $linenumber (default null) + * @param int|null $linenumber (default null) * * @return string */ @@ -409,14 +409,14 @@ class EnhancedChangesList extends ChangesList { # Log timestamp if ( $type == RC_LOG ) { - $link = $rcObj->timestamp; + $link = htmlspecialchars( $rcObj->timestamp ); # Revision link } elseif ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) { - $link = '' . $rcObj->timestamp . ' '; + $link = Html::element( 'span', [ 'class' => 'history-deleted' ], $rcObj->timestamp ); } else { $link = $this->linkRenderer->makeKnownLink( $rcObj->getTitle(), - new HtmlArmor( $rcObj->timestamp ), + $rcObj->timestamp, [], $params ); @@ -472,7 +472,10 @@ class EnhancedChangesList extends ChangesList { // skip entry if hook aborted it return []; } - $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] ); + $attribs = array_filter( $attribs, + [ Sanitizer::class, 'isReservedDataAttribute' ], + ARRAY_FILTER_USE_KEY + ); $lineParams['recentChangesFlagsRaw'] = []; if ( isset( $data['recentChangesFlags'] ) ) { @@ -642,7 +645,7 @@ class EnhancedChangesList extends ChangesList { ]; // timestamp is not really a link here, but is called timestampLink // for consistency with EnhancedChangesListModifyLineData - $data['timestampLink'] = $rcObj->timestamp; + $data['timestampLink'] = htmlspecialchars( $rcObj->timestamp ); # Article or log link if ( $logType ) { @@ -704,9 +707,9 @@ class EnhancedChangesList extends ChangesList { } $attribs = $data['attribs']; unset( $data['attribs'] ); - $attribs = wfArrayFilterByKey( $attribs, function ( $key ) { + $attribs = array_filter( $attribs, function ( $key ) { return $key === 'class' || Sanitizer::isReservedDataAttribute( $key ); - } ); + }, ARRAY_FILTER_USE_KEY ); $prefix = ''; if ( is_callable( $this->changeLinePrefixer ) ) {