Merge "Handle missing namespace prefix in XML dumps more gracefully"
[lhc/web/wiklou.git] / includes / SiteStats.php
index ff7875c..105a581 100644 (file)
@@ -186,6 +186,7 @@ class SiteStats {
                        wfMemcKey( 'SiteStats', 'groupcounts', $group ),
                        $cache::TTL_HOUR,
                        function ( $oldValue, &$ttl, array &$setOpts ) use ( $group ) {
+                               global $wgDisableUserGroupExpiry;
                                $dbr = wfGetDB( DB_REPLICA );
 
                                $setOpts += Database::getCacheSetOptions( $dbr );
@@ -193,7 +194,12 @@ class SiteStats {
                                return $dbr->selectField(
                                        'user_groups',
                                        'COUNT(*)',
-                                       [ 'ug_group' => $group ],
+                                       [
+                                               'ug_group' => $group,
+                                               $wgDisableUserGroupExpiry ?
+                                                       '1' :
+                                                       'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
+                                       ],
                                        __METHOD__
                                );
                        },