Merge "statsd: Rename MediawikiStatsdDataFactory to IBufferingStatsdDataFactory"
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index d856d4b..2fe56f9 100644 (file)
@@ -138,9 +138,6 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
         * @param string $subpage
         */
        public function execute( $subpage ) {
-               global $wgStructuredChangeFiltersEnableSaving,
-                       $wgStructuredChangeFiltersEnableExperimentalViews;
-
                // Backwards-compatibility: redirect to new feed URLs
                $feedFormat = $this->getRequest()->getVal( 'feed' );
                if ( !$this->including() && $feedFormat ) {
@@ -180,19 +177,28 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                                )
                        );
 
+                       $experimentalStructuredChangeFilters =
+                               $this->getConfig()->get( 'StructuredChangeFiltersEnableExperimentalViews' );
+
                        $out->addJsConfigVars( 'wgStructuredChangeFilters', $jsData['groups'] );
                        $out->addJsConfigVars(
                                'wgStructuredChangeFiltersEnableSaving',
-                               $wgStructuredChangeFiltersEnableSaving
+                               $this->getConfig()->get( 'StructuredChangeFiltersEnableSaving' )
                        );
                        $out->addJsConfigVars(
                                'wgStructuredChangeFiltersEnableExperimentalViews',
-                               $wgStructuredChangeFiltersEnableExperimentalViews
+                               $experimentalStructuredChangeFilters
                        );
                        $out->addJsConfigVars(
-                               'wgRCFiltersChangeTags',
-                               $this->buildChangeTagList()
+                               'wgStructuredChangeFiltersEnableLiveUpdate',
+                               $this->getConfig()->get( 'StructuredChangeFiltersEnableLiveUpdate' )
                        );
+                       if ( $experimentalStructuredChangeFilters ) {
+                               $out->addJsConfigVars(
+                                       'wgRCFiltersChangeTags',
+                                       $this->buildChangeTagList()
+                               );
+                       }
                }
        }
 
@@ -202,10 +208,6 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
         * @return Array Tag data
         */
        protected function buildChangeTagList() {
-               function stripAllHtml( $input ) {
-                       return trim( html_entity_decode( strip_tags( $input ) ) );
-               }
-
                $explicitlyDefinedTags = array_fill_keys( ChangeTags::listExplicitlyDefinedTags(), 0 );
                $softwareActivatedTags = array_fill_keys( ChangeTags::listSoftwareActivatedTags(), 0 );
                $tagStats = ChangeTags::tagUsageStatistics();
@@ -228,8 +230,10 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
 
                                $result[] = [
                                        'name' => $tagName,
-                                       'label' => stripAllHtml( ChangeTags::tagDescription( $tagName, $this->getContext() ) ),
-                                       'description' => $desc ? stripAllHtml( $desc->parse() ) : '',
+                                       'label' => Sanitizer::stripAllTags(
+                                               ChangeTags::tagDescription( $tagName, $this->getContext() )
+                                       ),
+                                       'description' => $desc ? Sanitizer::stripAllTags( $desc->parse() ) : '',
                                        'cssClass' => Sanitizer::escapeClass( 'mw-tag-' . $tagName ),
                                        'hits' => $hits,
                                ];