Skip to content

Commit

Permalink
Bugfix: encrypting/decrypting empty values.
Browse files Browse the repository at this point in the history
Encrypting/decrypting empty values returns not usable strings.
  • Loading branch information
johnciocoiu committed Feb 11, 2015
1 parent efc29b5 commit 58d21d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Subscribers/DoctrineEncryptSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ private function processFields($entity, $isEncryptOperation = true)
$withAnnotation = true;
// we have annotation and if it decrypt operation, we must avoid duble decryption
$refProperty->setAccessible(true);
if (empty($value)) continue;

$value = $refProperty->getValue($entity);
$value = $this->encryptor->$encryptorMethod($value);
$refProperty->setValue($entity, $value);
Expand Down

0 comments on commit 58d21d0

Please sign in to comment.