From 74b4736cd0cfe46bfb742586825ce36c85c62f9a Mon Sep 17 00:00:00 2001 From: Tobias Niebergall Date: Sun, 24 May 2015 21:03:00 +0200 Subject: [PATCH] Changed function getAlias Changed the function getAlias to replace the urlSuffix last, because if you're using a "/" as urlSuffix the extension will crash. --- .../MetaModels/Index/Index.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/TL_ROOT/system/modules/metamodels_index/MetaModels/Index/Index.php b/TL_ROOT/system/modules/metamodels_index/MetaModels/Index/Index.php index 3ec11b8..a10e0d8 100644 --- a/TL_ROOT/system/modules/metamodels_index/MetaModels/Index/Index.php +++ b/TL_ROOT/system/modules/metamodels_index/MetaModels/Index/Index.php @@ -98,19 +98,10 @@ public function getSearchablePagesModel($arrData) */ protected function getAlias($strLink) { - if ($GLOBALS['TL_CONFIG']['rewriteURL'] == false) { $strLink = str_replace('index.php/', '', $strLink); } - if ($GLOBALS['TL_CONFIG']['urlSuffix']) { - $strLink = str_replace( - $GLOBALS['TL_CONFIG']['urlSuffix'], - '', - $strLink - ); - } - $strLink = str_replace(\Environment::get('base'), '', $strLink); $strLang = ''; @@ -123,9 +114,17 @@ protected function getAlias($strLink) $strLink = implode('/', $strLink); } + + if ($GLOBALS['TL_CONFIG']['urlSuffix']) { + $strLink = str_replace( + $GLOBALS['TL_CONFIG']['urlSuffix'], + '', + $strLink + ); + } $arrLink = array('alias' => $strLink, 'language' => $strLang); - + return $arrLink; }