From 693ef9a3e630cda28ca5b2263601f0e76ded1433 Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Tue, 30 Jul 2024 19:10:43 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9finition=20de=20l'env=20gpg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cryptography.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cryptography.class.php b/lib/cryptography.class.php index d966328..0faae39 100644 --- a/lib/cryptography.class.php +++ b/lib/cryptography.class.php @@ -25,6 +25,7 @@ private function getFiles($isGpg) { } public function encrypt() { + putenv('HOME='.sys_get_temp_dir()); foreach ($this->getFiles(false) as $file) { $outputFile = $file.".gpg"; $command = "gpg --no-options --batch --passphrase $this->symmetricKey --symmetric --cipher-algo AES256 -o $outputFile $file"; @@ -47,7 +48,7 @@ public function decrypt() { return false; } $decryptFolder = sys_get_temp_dir()."/".uniqid('pdfsignature.decrypted.'.getmypid(), true); - echo $decryptFolder."\n"; + putenv('HOME='.$decryptFolder); mkdir($decryptFolder); foreach ($this->getFiles(true) as $file) { $outputFile = $decryptFolder."/".str_replace(".gpg", "", basename($file));