From 1e133bbbdf0f0294b88f5be6c5b420b083415bd4 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Sat, 25 Apr 2020 04:50:47 +0000 Subject: [PATCH 1/2] fix: skip validation of non-dirty path --- php-classes/Gatekeeper/Endpoints/Endpoint.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php-classes/Gatekeeper/Endpoints/Endpoint.php b/php-classes/Gatekeeper/Endpoints/Endpoint.php index 959d4e4..4999222 100644 --- a/php-classes/Gatekeeper/Endpoints/Endpoint.php +++ b/php-classes/Gatekeeper/Endpoints/Endpoint.php @@ -245,6 +245,10 @@ public static function validatePath(RecordValidator $validator, Endpoint $Endpoi return; } + if (!$Endpoint->isFieldDirty('Path')) { + return; + } + $duplicateConditions = [ 'Path' => $Endpoint->Path ]; From 16243939ccbc4eacffecc4d5938bf26f0fa547cc Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Sat, 25 Apr 2020 04:56:56 +0000 Subject: [PATCH 2/2] fix: use strict equality to test rewrite cache hit --- php-classes/Gatekeeper/Endpoints/Endpoint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-classes/Gatekeeper/Endpoints/Endpoint.php b/php-classes/Gatekeeper/Endpoints/Endpoint.php index 4999222..d73db40 100644 --- a/php-classes/Gatekeeper/Endpoints/Endpoint.php +++ b/php-classes/Gatekeeper/Endpoints/Endpoint.php @@ -353,7 +353,7 @@ public function applyRewrites($url) $cacheKey = "endpoints/$this->ID/rewrites"; // get ordered list of rewrites - if (false == ($rewriteIDs = Cache::fetch($cacheKey))) { + if (false === ($rewriteIDs = Cache::fetch($cacheKey))) { $rewriteIDs = array_map(function($Rewrite) { return $Rewrite->ID; }, $this->Rewrites);