N°4058 - Setup failed when added an encrypted field due to default value NULL non SODIUM compatible (#754)

* N°4058 - Setup failed when added an encrypted field due to default value NULL non SODIUM compatible

* N°4058 - Setup failed when added an encrypted field due to default value NULL non SODIUM compatible

* change log level to warning
This commit is contained in:
odain-cbd
2025-10-10 14:25:39 +02:00
committed by GitHub
parent 0fe2183369
commit 318b792b31
2 changed files with 46 additions and 2 deletions

View File

@@ -130,7 +130,15 @@ class SimpleCrypt
*/
function Decrypt($key, $string)
{
return $this->oEngine->Decrypt($key,$string);
try{
return $this->oEngine->Decrypt($key,$string);
} catch(\Exception $e){
if (strlen($string)==0){
IssueLog::Warning("Cannot decrypt empty/null value", null, ['msg' => $e->getMessage(), 'stack' => $e->getTraceAsString()]);
return $string;
}
throw $e;
}
}
/**
@@ -422,4 +430,4 @@ class SimpleCryptOpenSSLMcryptCompatibilityEngine implements CryptEngine
return trim($plaintext);
}
}
}