From ccc5d3a888ea3d47f919e7aebb020dfb1dd6c410 Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 8 Nov 2024 09:24:15 +0800 Subject: [PATCH] + [refac] check if the label already used. --- lib/cache/cache.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cache/cache.class.php b/lib/cache/cache.class.php index 1898a0a273..b35fdaf0a0 100644 --- a/lib/cache/cache.class.php +++ b/lib/cache/cache.class.php @@ -709,6 +709,7 @@ class cache { if(empty($label)) return $this->log('The label is empty', __FILE__, __LINE__); if(empty($this->key)) return $this->log('The key is empty', __FILE__, __LINE__); + if(isset($this->labels[$label])) return $this->log("Label {$label} already used", __FILE__, __LINE__); $this->labels[$label] = $this->key; return $this; }