From 4e68c9f0b692b5ce276c1cbe39e8f6d8104f3eb1 Mon Sep 17 00:00:00 2001 From: connor Date: Thu, 21 Mar 2024 09:26:18 +0100 Subject: [PATCH 1/3] [view] fix return statement missing stan error --- lib/view/sfViewCacheManager.class.php | 2 ++ lib/view/sfViewParameterHolder.class.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/view/sfViewCacheManager.class.php b/lib/view/sfViewCacheManager.class.php index bfbc78119..73f417089 100644 --- a/lib/view/sfViewCacheManager.class.php +++ b/lib/view/sfViewCacheManager.class.php @@ -442,6 +442,8 @@ public function remove($internalUri, $hostName = '', $vary = '', $contextualPref if ($this->cache->has($cacheKey)) { return $this->cache->remove($cacheKey); } + + return false; } /** diff --git a/lib/view/sfViewParameterHolder.class.php b/lib/view/sfViewParameterHolder.class.php index deac048d5..6461c82d6 100644 --- a/lib/view/sfViewParameterHolder.class.php +++ b/lib/view/sfViewParameterHolder.class.php @@ -77,6 +77,8 @@ public function initialize(sfEventDispatcher $dispatcher, $parameters = [], $opt $this->setEscaping(isset($options['escaping_strategy']) ? $options['escaping_strategy'] : false); $this->setEscapingMethod(isset($options['escaping_method']) ? $options['escaping_method'] : 'ESC_SPECIALCHARS'); + + return true; } /** From 9fa2cf7c3a0d23d4d4357ff9e896e6ee96f73300 Mon Sep 17 00:00:00 2001 From: connor Date: Thu, 21 Mar 2024 09:58:42 +0100 Subject: [PATCH 2/3] changed return true. "as if the key is not there, it is like is has been removed successfully" --- lib/view/sfViewCacheManager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/view/sfViewCacheManager.class.php b/lib/view/sfViewCacheManager.class.php index 73f417089..07eb7bb99 100644 --- a/lib/view/sfViewCacheManager.class.php +++ b/lib/view/sfViewCacheManager.class.php @@ -443,7 +443,7 @@ public function remove($internalUri, $hostName = '', $vary = '', $contextualPref return $this->cache->remove($cacheKey); } - return false; + return true; } /** From 45e2d6d46573a41d3298dbd7b177aa9c1adc874e Mon Sep 17 00:00:00 2001 From: Connor Date: Thu, 21 Mar 2024 10:05:01 +0100 Subject: [PATCH 3/3] changed early return Co-authored-by: Emanuele Panzeri --- lib/view/sfViewCacheManager.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/view/sfViewCacheManager.class.php b/lib/view/sfViewCacheManager.class.php index 07eb7bb99..2ccaa0139 100644 --- a/lib/view/sfViewCacheManager.class.php +++ b/lib/view/sfViewCacheManager.class.php @@ -439,11 +439,11 @@ public function remove($internalUri, $hostName = '', $vary = '', $contextualPref if (strpos($cacheKey, '*')) { return $this->cache->removePattern($cacheKey); } - if ($this->cache->has($cacheKey)) { - return $this->cache->remove($cacheKey); + if (!$this->cache->has($cacheKey)) { + return true; } - return true; + return $this->cache->remove($cacheKey); } /**