objectcache: fix failing tests for non-HashBagOStuff backends
[lhc/web/wiklou.git] / includes / libs / objectcache / BagOStuff.php
index e9fd7d9..da60c01 100644 (file)
@@ -130,7 +130,7 @@ abstract class BagOStuff implements IExpiringStore, IStoreKeyEncoder, LoggerAwar
 
                if ( $value === false ) {
                        $value = $callback( $ttl );
-                       if ( $value !== false ) {
+                       if ( $value !== false && $ttl >= 0 ) {
                                $this->set( $key, $value, $ttl, $flags );
                        }
                }