ChangeTags: Remove $wgRequest abuse in modifyDisplayQuery()
authorRoan Kattouw <roan.kattouw@gmail.com>
Sat, 15 Jul 2017 02:49:10 +0000 (19:49 -0700)
committerCatrope <roan@wikimedia.org>
Mon, 24 Jul 2017 23:54:13 +0000 (23:54 +0000)
If you omitted the $filter_tag parameter or set it to false,
this would go grab the 'tagfilter' query string parameter from
$wgRequest and use it instead.

Thankfully no callers (in core or extensions) used this scary
misfeature, so we can just remove it.

Change-Id: Ib5d1b9f90989903f99a0d163745879df24f45b6a

includes/changetags/ChangeTags.php

index 6ea4812..2eb9b22 100644 (file)
@@ -654,17 +654,13 @@ class ChangeTags {
         * @param string|array $conds Conditions used in query, see Database::select
         * @param array $join_conds Join conditions, see Database::select
         * @param string|array $options Options, see Database::select
-        * @param bool|string|array $filter_tag Tag(s) to select on
+        * @param string|array $filter_tag Tag(s) to select on
         *
         * @throws MWException When unable to determine appropriate JOIN condition for tagging
         */
        public static function modifyDisplayQuery( &$tables, &$fields, &$conds,
-                                                                               &$join_conds, &$options, $filter_tag = false ) {
-               global $wgRequest, $wgUseTagFilter;
-
-               if ( $filter_tag === false ) {
-                       $filter_tag = $wgRequest->getVal( 'tagfilter' );
-               }
+                                                                               &$join_conds, &$options, $filter_tag = '' ) {
+               global $wgUseTagFilter;
 
                // Normalize to arrays
                $tables = (array)$tables;