Skip to content

Commit e5208f5

Browse files
committed
MAGETWO-36930: [GITHUB] Store config re-encrypt encrypted values on save #1223
- Removed unnecessary if condition since encrypted value is checked for empty earlier
1 parent e268946 commit e5208f5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/code/Magento/Config/Model/Config/Backend/Encrypted.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
namespace Magento\Config\Model\Config\Backend;
1212

13-
class Encrypted extends \Magento\Framework\App\Config\Value implements \Magento\Framework\App\Config\Data\ProcessorInterface
13+
class Encrypted extends \Magento\Framework\App\Config\Value implements
14+
\Magento\Framework\App\Config\Data\ProcessorInterface
1415
{
1516
/**
1617
* @var \Magento\Framework\Encryption\EncryptorInterface
@@ -58,7 +59,9 @@ public function __sleep()
5859
public function __wakeup()
5960
{
6061
parent::__wakeup();
61-
$this->_encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\Encryption\EncryptorInterface');
62+
$this->_encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get(
63+
'Magento\Framework\Encryption\EncryptorInterface'
64+
);
6265
}
6366

6467
/**
@@ -87,9 +90,7 @@ public function beforeSave()
8790
if (!preg_match('/^\*+$/', $value) && !empty($value)) {
8891
$this->_dataSaveAllowed = true;
8992
$encrypted = $this->_encryptor->encrypt($value);
90-
if ($encrypted) {
91-
$this->setValue($encrypted);
92-
}
93+
$this->setValue($encrypted);
9394
}
9495
}
9596

0 commit comments

Comments
 (0)