From 3166f4403889fa9feed99b8c6df703b118a4bdc0 Mon Sep 17 00:00:00 2001 From: Steve Winter Date: Fri, 8 May 2020 15:47:29 +0100 Subject: [PATCH] Adding suffix check back in to subscriber --- Subscribers/DoctrineEncryptSubscriber.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Subscribers/DoctrineEncryptSubscriber.php b/Subscribers/DoctrineEncryptSubscriber.php index 2cca8b19..44dbfafd 100644 --- a/Subscribers/DoctrineEncryptSubscriber.php +++ b/Subscribers/DoctrineEncryptSubscriber.php @@ -266,7 +266,7 @@ public function processFields($entity, $isEncryptOperation = true) { $value = $pac->getValue($entity, $refProperty->getName()); if($encryptorMethod == "decrypt") { if(!is_null($value) and !empty($value)) { - if(substr($value, -5) == "") { + if(substr($value, -5) == $this->suffix) { $this->decryptCounter++; $currentPropValue = $this->encryptor->decrypt(substr($value, 0, -5)); $pac->setValue($entity, $refProperty->getName(), $currentPropValue); @@ -274,7 +274,7 @@ public function processFields($entity, $isEncryptOperation = true) { } } else { if(!is_null($value) and !empty($value)) { - if(substr($value, -5) != "") { + if(substr($value, -5) != $this->suffix) { $this->encryptCounter++; $currentPropValue = $this->encryptor->encrypt($value); $pac->setValue($entity, $refProperty->getName(), $currentPropValue);