From 187029a36bb2084cc8846d38c42112b9dba388af Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sun, 8 Nov 2020 00:43:39 +0100 Subject: [PATCH] Use gpg command (over gpg2) with specific homedir --- src/MDMailerHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MDMailerHelper.php b/src/MDMailerHelper.php index 88013bd..03943b1 100644 --- a/src/MDMailerHelper.php +++ b/src/MDMailerHelper.php @@ -23,7 +23,7 @@ final class MDMailerHelper { */ public static function pgp_encrypt(string $to, string $msg):string { - $msg = shell_exec("echo " . escapeshellarg($msg) . " | gpg2 --always-trust --recipient " . escapeshellarg($to) . " --encrypt --armor --local-user " . escapeshellarg(MD_CONF_EMAIL::PGP_ENC_KEY) . " --sign"); + $msg = shell_exec("echo " . escapeshellarg($msg) . " | gpg --always-trust --homedir " . escapeshellarg(MD_CONF_EMAIL::PGP_HOMEDIR) . " --recipient " . escapeshellarg($to) . " --encrypt --armor --local-user " . escapeshellarg(MD_CONF_EMAIL::PGP_ENC_KEY) . " --sign"); if ($msg === null) return "Error encrypting message"; return $msg;