From 7e5b39f289da67ed74695b893bd4f05989ccb157 Mon Sep 17 00:00:00 2001 From: "M. Vondano" Date: Mon, 22 Feb 2021 19:41:59 +0100 Subject: [PATCH] handle illegal array access --- core-bundle/src/Resources/contao/dca/tl_page.php | 2 +- core-bundle/src/Resources/contao/drivers/DC_Table.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-bundle/src/Resources/contao/dca/tl_page.php b/core-bundle/src/Resources/contao/dca/tl_page.php index 563753f9e33..ae63d287202 100644 --- a/core-bundle/src/Resources/contao/dca/tl_page.php +++ b/core-bundle/src/Resources/contao/dca/tl_page.php @@ -1461,7 +1461,7 @@ public function pastePage(DataContainer $dc, $row, $table, $cr, $arrClipboard=nu } // Prevent adding non-root pages on top-level - if ($row['pid'] == 0 && Input::get('mode') != 'create') + if (($row['pid'] ?? null) == 0 && Input::get('mode') != 'create') { $objPage = $this->Database->prepare("SELECT * FROM " . $table . " WHERE id=?") ->limit(1) diff --git a/core-bundle/src/Resources/contao/drivers/DC_Table.php b/core-bundle/src/Resources/contao/drivers/DC_Table.php index 428681a05e6..fad8325a976 100644 --- a/core-bundle/src/Resources/contao/drivers/DC_Table.php +++ b/core-bundle/src/Resources/contao/drivers/DC_Table.php @@ -3666,7 +3666,7 @@ protected function treeView() $_buttons = ' '; // Show paste button only if there are no root records specified - if ($blnClipboard && ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['mode'] ?? null) == 5 && ((empty($GLOBALS['TL_DCA'][$table]['list']['sorting']['root']) && $GLOBALS['TL_DCA'][$table]['list']['sorting']['root'] !== false) || ($GLOBALS['TL_DCA'][$table]['list']['sorting']['rootPaste'] ?? null)) && Input::get('act') != 'select') + if ($blnClipboard && ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['mode'] ?? null) == 5 && ((empty($GLOBALS['TL_DCA'][$table]['list']['sorting']['root']) && ($GLOBALS['TL_DCA'][$table]['list']['sorting']['root'] ?? null) !== false) || ($GLOBALS['TL_DCA'][$table]['list']['sorting']['rootPaste'] ?? null)) && Input::get('act') != 'select') { // Call paste_button_callback (&$dc, $row, $table, $cr, $childs, $previous, $next) if (\is_array($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['paste_button_callback'] ?? null))