From 94634f2fc55146eaa26e333461f39a3257e6218c Mon Sep 17 00:00:00 2001 From: Lachlan Turner Date: Fri, 17 Jun 2022 12:03:23 +0930 Subject: [PATCH 1/2] BEG-81: Remove trailing slash characters from product URLs --- Model/Product/GetUrlsForProducts.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Model/Product/GetUrlsForProducts.php b/Model/Product/GetUrlsForProducts.php index 0fd6985..808128f 100644 --- a/Model/Product/GetUrlsForProducts.php +++ b/Model/Product/GetUrlsForProducts.php @@ -73,7 +73,8 @@ public function execute(array $productIds, int $storeId): array continue; } try { - $urls[] = $store->getUrl($urlPath); + // remove trailing slashes from urls + $urls[] = rtrim($store->getUrl($urlPath), ','); } catch (NoSuchEntityException $e) { continue; } From 80e1095dfb6d6d55e25b2d618d0ff3fc80e62110 Mon Sep 17 00:00:00 2001 From: Lachlan Turner Date: Fri, 17 Jun 2022 12:04:52 +0930 Subject: [PATCH 2/2] BEG-81: Fix typo of comma instead of slash --- Model/Product/GetUrlsForProducts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Product/GetUrlsForProducts.php b/Model/Product/GetUrlsForProducts.php index 808128f..f89d498 100644 --- a/Model/Product/GetUrlsForProducts.php +++ b/Model/Product/GetUrlsForProducts.php @@ -74,7 +74,7 @@ public function execute(array $productIds, int $storeId): array } try { // remove trailing slashes from urls - $urls[] = rtrim($store->getUrl($urlPath), ','); + $urls[] = rtrim($store->getUrl($urlPath), '/'); } catch (NoSuchEntityException $e) { continue; }