mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 02:59:21 +03:00
Prevent decrypt error for #859
This commit is contained in:
parent
b182372b83
commit
c4df524a06
2 changed files with 11 additions and 4 deletions
|
|
@ -91,9 +91,11 @@ abstract class AbstractConfig implements \JsonSerializable
|
|||
public function getDecrypted(string $sSection, string $sName, $mDefault = null)
|
||||
{
|
||||
// $salt = \basename($this->sFile) not possible due to RainLoop\Plugins\Property
|
||||
return isset($this->aData[$sSection][$sName][0])
|
||||
? \SnappyMail\Crypt::DecryptFromJSON($this->aData[$sSection][$sName][0], \APP_SALT)
|
||||
: $mDefault;
|
||||
if (!empty($this->aData[$sSection][$sName][0])) try {
|
||||
return \SnappyMail\Crypt::DecryptFromJSON($this->aData[$sSection][$sName][0], \APP_SALT);
|
||||
} catch (\Throwable $e) {
|
||||
}
|
||||
return $mDefault;
|
||||
}
|
||||
|
||||
public function setEncrypted(string $sSectionKey, string $sParamKey, $mParamValue) : void
|
||||
|
|
|
|||
|
|
@ -187,9 +187,14 @@ class Property implements \JsonSerializable
|
|||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize()
|
||||
{
|
||||
$mValue = $this->mValue;
|
||||
if ($this->encrypted && $mValue) try {
|
||||
$mValue = \SnappyMail\Crypt::DecryptFromJSON($mValue, \APP_SALT);
|
||||
} catch (\Throwable $e) {
|
||||
}
|
||||
return array(
|
||||
'@Object' => 'Object/PluginProperty',
|
||||
'value' => $this->encrypted ? \SnappyMail\Crypt::DecryptFromJSON($this->mValue, \APP_SALT) : $this->mValue,
|
||||
'value' => $mValue,
|
||||
'placeholder' => $this->sPlaceholder,
|
||||
'name' => $this->sName,
|
||||
'type' => $this->iType,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue