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));