Fix
This commit is contained in:
+2
-2
@@ -34,7 +34,7 @@ function is_https_request(): bool {
|
||||
/**
|
||||
* AES-256-GCM / AES-256-CBC encryptie helper voor gevoelige tokens (OAuth, API keys)
|
||||
*/
|
||||
function fociz_encrypt(string $plaintext): string {
|
||||
function fociz_encrypt(?string $plaintext): string {
|
||||
if (empty($plaintext)) return '';
|
||||
$key = hash('sha256', defined('APP_SECRET') ? APP_SECRET : 'fociz-maria-db-super-secret-key-998877', true);
|
||||
$iv = random_bytes(16);
|
||||
@@ -46,7 +46,7 @@ function fociz_encrypt(string $plaintext): string {
|
||||
/**
|
||||
* AES-256-CBC decryptie helper; decodeert indien versleuteld, laat legacy plaintext ongemoeid
|
||||
*/
|
||||
function fociz_decrypt(string $ciphertext): string {
|
||||
function fociz_decrypt(?string $ciphertext): string {
|
||||
if (empty($ciphertext)) return '';
|
||||
if (!str_starts_with($ciphertext, 'ENC:')) {
|
||||
return $ciphertext; // Plaintext legacy waarde
|
||||
|
||||
Reference in New Issue
Block a user