Skip to content

Commit

Permalink
handle illegal array access
Browse files Browse the repository at this point in the history
  • Loading branch information
m-vo committed Feb 22, 2021
1 parent 1873bcc commit 7e5b39f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/dca/tl_page.php
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/drivers/DC_Table.php
Expand Up @@ -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))
Expand Down

0 comments on commit 7e5b39f

Please sign in to comment.