Skip to content

Commit

Permalink
Added missing tables tl_faq and tl_files to global tags settings
Browse files Browse the repository at this point in the history
Fixed the injection for tl_content which caused a strange side effect for the "Module" content element
  • Loading branch information
hschottm committed Jul 18, 2022
1 parent 100a401 commit 35817cd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
$GLOBALS['tags_extension']['sourcetable'][] = 'tl_content';
$GLOBALS['tags_extension']['sourcetable'][] = 'tl_news';
$GLOBALS['tags_extension']['sourcetable'][] = 'tl_member';
$GLOBALS['tags_extension']['sourcetable'][] = 'tl_faq';
$GLOBALS['tags_extension']['sourcetable'][] = 'fl_files';

/**
* Add 'tag' to the URL keywords to prevent problems with URL manipulating modules like folderurl
Expand Down
2 changes: 2 additions & 0 deletions dca/tl_calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
if (@class_exists("tl_calendar"))
{

/*
if (is_array($GLOBALS['TL_DCA']['tl_calendar']['config']['onload_callback']))
{
foreach ($GLOBALS['TL_DCA']['tl_calendar']['config']['onload_callback'] as $key => $arr)
Expand All @@ -21,6 +22,7 @@
}
}
}
*/

}

2 changes: 2 additions & 0 deletions dca/tl_calendar_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
if (@class_exists("tl_calendar_events"))
{

/*
if (is_array($GLOBALS['TL_DCA']['tl_calendar_events']['config']['onload_callback']))
{
foreach ($GLOBALS['TL_DCA']['tl_calendar_events']['config']['onload_callback'] as $key => $arr)
Expand All @@ -21,6 +22,7 @@
}
}
}
*/

class tl_calendar_events_tags extends \Backend
{
Expand Down
10 changes: 5 additions & 5 deletions dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

if (!in_array('tl_content', $disabledObjects))
{
foreach ($GLOBALS['TL_DCA']['tl_content']['palettes'] as $key => $palette)
foreach ($GLOBALS['TL_DCA']['tl_content']['palettes'] as $key => &$palette)
{
if (strcmp($key, '__selector__') != 0)
{
$value = $GLOBALS['TL_DCA']['tl_content']['palettes'][$key];
if (strlen($value) >= 2) {
$pos = strpos($value, '{', 2);
if (strlen($palette) >= 2) {
$pos = strpos($palette, '{', 2);
if ($pos !== FALSE)
{
$GLOBALS['TL_DCA']['tl_content']['palettes'][$key] = substr($GLOBALS['TL_DCA']['tl_content']['palettes'][$key],0,$pos) . "{tags_legend:hide},tags;" . substr($GLOBALS['TL_DCA']['tl_content']['palettes'][$key],$pos);
$palette = substr($palette,0,$pos) . "{tags_legend:hide},tags;" . substr($palette,$pos);
}
}
}
}
unset($palette);

$GLOBALS['TL_DCA']['tl_content']['palettes']['headline'] = str_replace('guests','guests,tagsonly', $GLOBALS['TL_DCA']['tl_content']['palettes']['headline']);
$GLOBALS['TL_DCA']['tl_content']['config']['ondelete_callback'][] = array('tl_content_tags', 'removeContentElement');
Expand Down
5 changes: 3 additions & 2 deletions dca/tl_news.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@

if (is_array($GLOBALS['TL_DCA']['tl_news']['config']['onload_callback']))
{
foreach ($GLOBALS['TL_DCA']['tl_news']['config']['onload_callback'] as $key => $arr)
foreach ($GLOBALS['TL_DCA']['tl_news']['config']['onload_callback'] as $key => &$arr)
{
if (is_array($arr) && strcmp($arr[0], 'tl_news') == 0 && strcmp($arr[1], 'generateFeed') == 0)
{
$GLOBALS['TL_DCA']['tl_news']['config']['onload_callback'][$key] = array('TagHelper', 'generateNewsFeed');
$arr = array('TagHelper', 'generateNewsFeed');
}
}
unset($arr);
}


Expand Down
2 changes: 2 additions & 0 deletions dca/tl_news_archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

if (@class_exists("tl_news_archive"))
{
/*
if (is_array($GLOBALS['TL_DCA']['tl_news_archive']['config']['onload_callback']))
{
foreach ($GLOBALS['TL_DCA']['tl_news_archive']['config']['onload_callback'] as $key => $arr)
Expand All @@ -20,6 +21,7 @@
}
}
}
*/

}

0 comments on commit 35817cd

Please sign in to comment.