Skip to content

Commit

Permalink
MAGETWO-36930: [GITHUB] Store config re-encrypt encrypted values on s…
Browse files Browse the repository at this point in the history
…ave #1223

- Removed unnecessary if condition since encrypted value is checked for empty earlier
  • Loading branch information
anupdugar committed May 13, 2015
1 parent e268946 commit e5208f5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/code/Magento/Config/Model/Config/Backend/Encrypted.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

namespace Magento\Config\Model\Config\Backend;

class Encrypted extends \Magento\Framework\App\Config\Value implements \Magento\Framework\App\Config\Data\ProcessorInterface
class Encrypted extends \Magento\Framework\App\Config\Value implements
\Magento\Framework\App\Config\Data\ProcessorInterface
{
/**
* @var \Magento\Framework\Encryption\EncryptorInterface
Expand Down Expand Up @@ -58,7 +59,9 @@ public function __sleep()
public function __wakeup()
{
parent::__wakeup();
$this->_encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\Encryption\EncryptorInterface');
$this->_encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get(
'Magento\Framework\Encryption\EncryptorInterface'
);
}

/**
Expand Down Expand Up @@ -87,9 +90,7 @@ public function beforeSave()
if (!preg_match('/^\*+$/', $value) && !empty($value)) {
$this->_dataSaveAllowed = true;
$encrypted = $this->_encryptor->encrypt($value);
if ($encrypted) {
$this->setValue($encrypted);
}
$this->setValue($encrypted);
}
}

Expand Down

0 comments on commit e5208f5

Please sign in to comment.