Merge "Drop index oi_name_archive_name on table oldimage"
[lhc/web/wiklou.git] / includes / api / ApiQueryContributors.php
index ac5ccca..148e315 100644 (file)
@@ -160,7 +160,13 @@ class ApiQueryContributors extends ApiQueryBase {
                        $this->addTables( 'user_groups' );
                        $this->addJoinConds( [ 'user_groups' => [
                                $excludeGroups ? 'LEFT OUTER JOIN' : 'INNER JOIN',
-                               [ 'ug_user=rev_user', 'ug_group' => $limitGroups ]
+                               [
+                                       'ug_user=rev_user',
+                                       'ug_group' => $limitGroups,
+                                       $this->getConfig()->get( 'DisableUserGroupExpiry' ) ?
+                                               '1' :
+                                               'ug_expiry IS NULL OR ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+                               ]
                        ] ] );
                        $this->addWhereIf( 'ug_user IS NULL', $excludeGroups );
                }