Skip cache hint about 0 seconds on Special:ActiveUsers
authorumherirrender <umherirrender_de.wp@web.de>
Sun, 11 Jan 2015 10:39:20 +0000 (11:39 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sun, 11 Jan 2015 10:39:20 +0000 (11:39 +0100)
When the data on Special:ActiveUsers are up to date there is no need to
give a hint, seeing data from cache "which can be up to 0 seconds".

Change-Id: I46f80c7cdc083b997794fb9398887e2ef0088684

includes/specials/SpecialActiveusers.php

index 0caf6b4..66f1f03 100644 (file)
@@ -269,9 +269,11 @@ class SpecialActiveUsers extends SpecialPage {
 
                // Occasionally merge in new updates
                $seconds = min( self::mergeActiveUsers( 300, $days ), $days * 86400 );
-               // Mention the level of staleness
-               $out->addWikiMsg( 'cachedspecial-viewing-cached-ttl',
-                       $this->getLanguage()->formatDuration( $seconds ) );
+               if ( $seconds > 0 ) {
+                       // Mention the level of staleness
+                       $out->addWikiMsg( 'cachedspecial-viewing-cached-ttl',
+                               $this->getLanguage()->formatDuration( $seconds ) );
+               }
 
                $up = new ActiveUsersPager( $this->getContext(), null, $par );