From b085d5f9a292f4efb4047be922a50eb1905a8c78 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 19 Aug 2015 16:37:59 -0700 Subject: [PATCH] Added $ttl sanity check to WANObjectCache::delete() Change-Id: I48c80bd6ba5f79c94e87d75816f2e2069200c9aa --- includes/libs/objectcache/WANObjectCache.php | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.20.1