From: Aaron Schulz Date: Wed, 19 Aug 2015 23:37:59 +0000 (-0700) Subject: Added $ttl sanity check to WANObjectCache::delete() X-Git-Tag: 1.31.0-rc.0~10279^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/voir.php?a=commitdiff_plain;h=b085d5f9a292f4efb4047be922a50eb1905a8c78;p=lhc%2Fweb%2Fwiklou.git Added $ttl sanity check to WANObjectCache::delete() Change-Id: I48c80bd6ba5f79c94e87d75816f2e2069200c9aa --- diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index 36250b07c4..c541a9e15d 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -272,6 +272,8 @@ class WANObjectCache { */ final public function delete( $key, $ttl = self::HOLDOFF_TTL ) { $key = self::VALUE_KEY_PREFIX . $key; + // Avoid indefinite key salting for sanity + $ttl = max( $ttl, 1 ); // Update the local cluster immediately $ok = $this->cache->set( $key, self::PURGE_VAL_PREFIX . microtime( true ), $ttl ); // Publish the purge to all clusters