Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Merging the latest version 2.11 changes (see #3740)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jan 11, 2012
1 parent 2d02757 commit 0235b68
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -17,7 +17,9 @@ assets/css/*
assets/images/*
assets/js/*
share/*
system/html
system/logs/*
system/scripts
system/tmp/*
system/config/dcaconfig.php
system/config/initconfig.php
Expand Down
21 changes: 21 additions & 0 deletions system/modules/backend/drivers/DC_Table.php
Expand Up @@ -591,6 +591,13 @@ public function create($set=array())
if (isset($v['default']))
{
$this->set[$k] = is_array($v['default']) ? serialize($v['default']) : $v['default'];

// Encrypt the default value (see #3740)
if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['encrypt'])
{
$this->import('Encryption');
$this->set[$k] = $this->Encryption->encrypt($this->set[$k]);
}
}
}

Expand Down Expand Up @@ -779,6 +786,13 @@ public function copy($blnDoNotRedirect=false)
elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['doNotCopy'] || $GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['fallback'])
{
$v = $GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['default'] ? (is_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['default']) ? serialize($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['default']) : $GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['default']) : '';

// Encrypt the default value (see #3740)
if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['encrypt'])
{
$this->import('Encryption');
$v = $this->Encryption->encrypt($v);
}
}

// Set fields (except password fields)
Expand Down Expand Up @@ -945,6 +959,13 @@ protected function copyChilds($table, $insertID, $id, $parentId)
if ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['unique'] || $GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['doNotCopy'] || $GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['fallback'])
{
$vv = $GLOBALS['TL_DCA'][$v]['fields'][$kk]['default'] ? ((is_array($GLOBALS['TL_DCA'][$v]['fields'][$kk]['default'])) ? serialize($GLOBALS['TL_DCA'][$v]['fields'][$kk]['default']) : $GLOBALS['TL_DCA'][$v]['fields'][$kk]['default']) : '';

// Encrypt the default value (see #3740)
if ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['encrypt'])
{
$this->import('Encryption');
$vv = $this->Encryption->encrypt($vv);
}
}

$copy[$v][$row['id']][$kk] = $vv;
Expand Down

0 comments on commit 0235b68

Please sign in to comment.