From db4608a9b5c2eebe6119fc083cba38416338c14e Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 10 Aug 2018 19:52:09 +0000 Subject: [PATCH] Issue 4814: Unify the temp path location --- diaspora/Diaspora_Connection.php | 2 +- diaspora/diasphp.php | 2 +- mailstream/phpmailer/class.phpmailer.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/diaspora/Diaspora_Connection.php b/diaspora/Diaspora_Connection.php index 675f15003..8b8811ece 100644 --- a/diaspora/Diaspora_Connection.php +++ b/diaspora/Diaspora_Connection.php @@ -29,7 +29,7 @@ class Diaspora_Connection { $this->setPassword($password); } - $this->cookiejar = tempnam(sys_get_temp_dir(), 'cookies'); + $this->cookiejar = tempnam(get_temppath(), 'cookies'); return $this; } diff --git a/diaspora/diasphp.php b/diaspora/diasphp.php index 6ed0c8ce5..f48933a62 100644 --- a/diaspora/diasphp.php +++ b/diaspora/diasphp.php @@ -11,7 +11,7 @@ class Diasphp { $this->token_regex = '/content="(.*?)" name="csrf-token/'; $this->pod = $pod; - $this->cookiejar = tempnam(sys_get_temp_dir(), 'cookies'); + $this->cookiejar = tempnam(get_temppath(), 'cookies'); } function __destruct() { diff --git a/mailstream/phpmailer/class.phpmailer.php b/mailstream/phpmailer/class.phpmailer.php index c2611e860..46ff4360c 100644 --- a/mailstream/phpmailer/class.phpmailer.php +++ b/mailstream/phpmailer/class.phpmailer.php @@ -2350,11 +2350,11 @@ class PHPMailer throw new phpmailerException($this->lang('extension_missing') . 'openssl'); } // @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 - $file = tempnam(sys_get_temp_dir(), 'mail'); + $file = tempnam(get_temppath(), 'mail'); if (false === file_put_contents($file, $body)) { throw new phpmailerException($this->lang('signing') . ' Could not write temp file'); } - $signed = tempnam(sys_get_temp_dir(), 'signed'); + $signed = tempnam(get_temppath(), 'signed'); //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197 if (empty($this->sign_extracerts_file)) { $sign = @openssl_pkcs7_sign(