From 12353b48909873ca5d71d6c11f7a896c70f3efda Mon Sep 17 00:00:00 2001 From: Joao Inacio Date: Tue, 29 Sep 2015 08:49:04 +0100 Subject: [PATCH] Fix EZP-24854: http cache purge bans wrong/additional location ids --- eZ/Publish/Core/MVC/Symfony/Cache/Http/FOSPurgeClient.php | 2 +- .../Core/MVC/Symfony/Cache/Tests/Http/FOSPurgeClientTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eZ/Publish/Core/MVC/Symfony/Cache/Http/FOSPurgeClient.php b/eZ/Publish/Core/MVC/Symfony/Cache/Http/FOSPurgeClient.php index d4251b6e9a5..8e9bf6031dd 100644 --- a/eZ/Publish/Core/MVC/Symfony/Cache/Http/FOSPurgeClient.php +++ b/eZ/Publish/Core/MVC/Symfony/Cache/Http/FOSPurgeClient.php @@ -41,7 +41,7 @@ public function purge($locationIds) $locationIds = array($locationIds); } - $this->cacheManager->invalidate(array('X-Location-Id' => '(' . implode('|', $locationIds) . ')')); + $this->cacheManager->invalidate(array('X-Location-Id' => '^(' . implode('|', $locationIds) . ')$')); } public function purgeAll() diff --git a/eZ/Publish/Core/MVC/Symfony/Cache/Tests/Http/FOSPurgeClientTest.php b/eZ/Publish/Core/MVC/Symfony/Cache/Tests/Http/FOSPurgeClientTest.php index 9652f58f91f..6272639431d 100644 --- a/eZ/Publish/Core/MVC/Symfony/Cache/Tests/Http/FOSPurgeClientTest.php +++ b/eZ/Publish/Core/MVC/Symfony/Cache/Tests/Http/FOSPurgeClientTest.php @@ -55,7 +55,7 @@ public function testPurgeOneLocationId() $this->cacheManager ->expects($this->once()) ->method('invalidate') - ->with(array('X-Location-Id' => "($locationId)")); + ->with(array('X-Location-Id' => "^($locationId)$")); $this->purgeClient->purge($locationId); } @@ -68,7 +68,7 @@ public function testPurge(array $locationIds) $this->cacheManager ->expects($this->once()) ->method('invalidate') - ->with(array('X-Location-Id' => '(' . implode('|', $locationIds) . ')')); + ->with(array('X-Location-Id' => '^(' . implode('|', $locationIds) . ')$')); $this->purgeClient->purge($locationIds); }