From a36e01ee8e386f1f2b003301cbce201502f27cd1 Mon Sep 17 00:00:00 2001 From: hschottm Date: Tue, 15 Sep 2020 15:21:43 +0200 Subject: [PATCH] Replaced non existing Contao 4.10 calls to encode ampersands with PHP calls --- classes/TagHelper.php | 8 ++++---- modules/ModuleTagCloud.php | 10 +++++----- modules/ModuleTagScope.php | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/classes/TagHelper.php b/classes/TagHelper.php index 2ea62f4..e0b78ef 100644 --- a/classes/TagHelper.php +++ b/classes/TagHelper.php @@ -177,7 +177,7 @@ private function getTagsForTableAndId($table, $id, $url = false, $max_tags = 0, { foreach ($arrTags as $idx => $tag) { - $arrTags[$idx]['url'] = StringUtil::ampersand($objPage->getFrontendUrl('/tag/' . $tag['tag'])); + $arrTags[$idx]['url'] = ampersand($objPage->getFrontendUrl('/tag/' . $tag['tag'])); } } } @@ -316,7 +316,7 @@ private function getTagsForArticle($moduleArticle, $max_tags = 0, $relevance = 0 { foreach ($arrTags as $idx => $tag) { - $arrTags[$idx]['url'] = StringUtil::ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag['tag']))); + $arrTags[$idx]['url'] = ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag['tag']))); } } } @@ -351,7 +351,7 @@ public function parseArticlesHook($objTemplate, $row) $taglist = array(); foreach ($tags as $id => $tag) { - $strUrl = StringUtil::ampersand($objPage->getFrontendUrl($items . '/tag/' . \TagHelper::encode($tag))); + $strUrl = ampersand($objPage->getFrontendUrl($items . '/tag/' . \TagHelper::encode($tag))); $tags[$id] = '' . StringUtil::specialchars($tag) . ''; $taglist[$id] = array( 'url' => $tags[$id], @@ -384,7 +384,7 @@ public function getTagsAndTaglistForIdAndTable($id, $table, $jumpto) $taglist = array(); foreach ($tags as $id => $tag) { - $strUrl = StringUtil::ampersand($objPage->getFrontendUrl($items . '/tag/' . \TagHelper::encode($tag))); + $strUrl = ampersand($objPage->getFrontendUrl($items . '/tag/' . \TagHelper::encode($tag))); if (strlen(\Environment::get('queryString'))) $strUrl .= "?" . \Environment::get('queryString'); $tags[$id] = '' . StringUtil::specialchars($tag) . ''; $taglist[$id] = array( diff --git a/modules/ModuleTagCloud.php b/modules/ModuleTagCloud.php index 2e32ba3..b9dccf5 100644 --- a/modules/ModuleTagCloud.php +++ b/modules/ModuleTagCloud.php @@ -92,7 +92,7 @@ protected function compile() protected function showTags() { $this->loadLanguageFile('tl_module'); - $strUrl = StringUtil::ampersand(\Environment::get('request')); + $strUrl = ampersand(\Environment::get('request')); // Get target page $objPageObject = $this->Database->prepare("SELECT id, alias FROM tl_page WHERE id=?") ->limit(1) @@ -111,7 +111,7 @@ protected function showTags() { if (count($pageArr)) { - $strUrl = StringUtil::ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag['tag_name']))); + $strUrl = ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag['tag_name']))); if (strlen($strParams)) { if (strpos($strUrl, '?') !== false) @@ -167,7 +167,7 @@ protected function showTags() if (count($pageArr)) { $allrelated = array_merge($relatedlist, array($tag['tag_name'])); - $strUrl = StringUtil::ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode(\TagHelper::decode(\Input::get('tag'))) . '/related/' . \TagHelper::encode(join($allrelated, ',')))); + $strUrl = ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode(\TagHelper::decode(\Input::get('tag'))) . '/related/' . \TagHelper::encode(join($allrelated, ',')))); } $this->arrRelated[$idx]['tag_url'] = $strUrl; } @@ -182,7 +182,7 @@ protected function showTags() $this->Template->selectedtags = (strlen(\TagHelper::decode(\Input::get('tag')))) ? (count($this->arrRelated)+1) : 0; if ($this->tag_show_reset) { - $strEmptyUrl = StringUtil::ampersand($objPage->getFrontendUrl('')); + $strEmptyUrl = ampersand($objPage->getFrontendUrl('')); if (strlen($strParams)) { if (strpos($strUrl, '?') !== false) @@ -207,7 +207,7 @@ protected function showTags() { if (count($pageArr)) { - $strUrl = StringUtil::ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag['tag_name']))); + $strUrl = ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag['tag_name']))); if (strlen($strParams)) { if (strpos($strUrl, '?') !== false) diff --git a/modules/ModuleTagScope.php b/modules/ModuleTagScope.php index 88a5dfb..c15caed 100644 --- a/modules/ModuleTagScope.php +++ b/modules/ModuleTagScope.php @@ -77,7 +77,7 @@ protected function compile() { if (count($pageArr)) { - $strUrl = StringUtil::ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag))); + $strUrl = ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag))); if (strlen($strParams)) { if (strpos($strUrl, '?') !== false) @@ -93,7 +93,7 @@ protected function compile() } } $this->Template->tag_urls = $tagurls; - $strEmptyUrl = StringUtil::ampersand($objPage->getFrontendUrl()); + $strEmptyUrl = ampersand($objPage->getFrontendUrl()); if (strlen($strParams)) { if (strpos($strEmptyUrl, '?') !== false) @@ -131,7 +131,7 @@ protected function compile() $related = array_slice($newarr, 1); $tagpath .= '/related/' . join($related, ','); } - $strUrl = StringUtil::ampersand($objPage->getFrontendUrl($tagpath)); + $strUrl = ampersand($objPage->getFrontendUrl($tagpath)); if (strlen($strParams)) { if (strpos($strUrl, '?') !== false)