Skip to content

Commit

Permalink
Replaced non existing Contao 4.10 calls to encode ampersands with PHP…
Browse files Browse the repository at this point in the history
… calls
  • Loading branch information
hschottm committed Sep 15, 2020
1 parent a94c49c commit 8be5a08
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions classes/TagHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']));
}
}
}
Expand Down Expand Up @@ -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'])));
}
}
}
Expand Down Expand Up @@ -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] = '<a href="' . $strUrl . '">' . StringUtil::specialchars($tag) . '</a>';
$taglist[$id] = array(
'url' => $tags[$id],
Expand Down Expand Up @@ -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] = '<a href="' . $strUrl . '">' . StringUtil::specialchars($tag) . '</a>';
$taglist[$id] = array(
Expand Down
10 changes: 5 additions & 5 deletions modules/ModuleTagCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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;
}
Expand All @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions modules/ModuleTagScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8be5a08

Please sign in to comment.