Skip to content

Commit

Permalink
Fixed an error that can occur in PHP 8 when a value is too short
Browse files Browse the repository at this point in the history
  • Loading branch information
hschottm committed Jun 13, 2022
1 parent f5f2ba6 commit 1207d4f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
{
if (strcmp($key, '__selector__') != 0)
{
$pos = strpos($GLOBALS['TL_DCA']['tl_content']['palettes'][$key], '{', 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);
$value = $GLOBALS['TL_DCA']['tl_content']['palettes'][$key];
if (strlen($value) >= 2) {
$pos = strpos($value, '{', 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);
}
}
}
}
Expand Down

0 comments on commit 1207d4f

Please sign in to comment.