From b06a82aa03e31def988c6b0f4d58cb6d0c4936d4 Mon Sep 17 00:00:00 2001 From: Jochem Klaver Date: Tue, 13 Jun 2017 14:49:10 +0200 Subject: [PATCH] Do not prefix with dot if there already is a dot --- .../community/Flagbit/FilterUrls/Helper/Data.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/code/community/Flagbit/FilterUrls/Helper/Data.php b/src/app/code/community/Flagbit/FilterUrls/Helper/Data.php index 6fcf449..9be0690 100644 --- a/src/app/code/community/Flagbit/FilterUrls/Helper/Data.php +++ b/src/app/code/community/Flagbit/FilterUrls/Helper/Data.php @@ -68,15 +68,20 @@ public function normalize($string) return $string; } + /** + * Get the configured URL suffix + * + * @return string + */ public function getUrlSuffix() { - $suffix = ''; - if(Mage::helper('core')->isModuleEnabled('Enterprise_Catalog')) - { - $suffix .= '.'; + $suffix = Mage::getStoreConfig('catalog/seo/category_url_suffix'); + if (Mage::helper('core')->isModuleEnabled('Enterprise_Catalog') + && substr($suffix, 0, 1) !== '.') { + $suffix = '.' . $suffix; } - $suffix .= Mage::getStoreConfig('catalog/seo/category_url_suffix'); return $suffix; } + }