-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Colinax
committed
Oct 24, 2020
1 parent
d32a5b9
commit 66e4992
Showing
11 changed files
with
83 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.1.7 | ||
6.1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
* @author Jim Jagielski (jimjag) <[email protected]> | ||
* @author Andy Prevost (codeworxtech) <[email protected]> | ||
* @author Brent R. Matzelle (original founder) | ||
* @copyright 2012 - 2017 Marcus Bointon | ||
* @copyright 2012 - 2020 Marcus Bointon | ||
* @copyright 2010 - 2012 Jim Jagielski | ||
* @copyright 2004 - 2009 Andy Prevost | ||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,27 @@ | |
* @package PHPMailer | ||
* @author Cecep Prawiro <[email protected]> | ||
* @author @januridp | ||
* @author Ian Mustafa <[email protected]> | ||
*/ | ||
|
||
$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; | ||
$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.'; | ||
$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; | ||
$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; | ||
$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; | ||
$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses : '; | ||
$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas : '; | ||
$PHPMAILER_LANG['file_open'] = 'Kesalahan File: Berkas tidak dapat dibuka : '; | ||
$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan : '; | ||
$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel'; | ||
$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak benar : '; | ||
$PHPMAILER_LANG['provide_address'] = 'Harus disediakan minimal satu alamat tujuan'; | ||
$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: '; | ||
$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: '; | ||
$PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: '; | ||
$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: '; | ||
$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.'; | ||
$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: '; | ||
$PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: '; | ||
$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: '; | ||
$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan'; | ||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; | ||
$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menghasilkan kesalahan : '; | ||
$PHPMAILER_LANG['signing'] = 'Kesalahan dalam tanda tangan : '; | ||
$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: '; | ||
$PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: '; | ||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; | ||
$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP : '; | ||
$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variable : '; | ||
$PHPMAILER_LANG['extension_missing'] = 'Ekstensi hilang: '; | ||
$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: '; | ||
$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: '; | ||
$PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: '; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @author Jim Jagielski (jimjag) <[email protected]> | ||
* @author Andy Prevost (codeworxtech) <[email protected]> | ||
* @author Brent R. Matzelle (original founder) | ||
* @copyright 2012 - 2017 Marcus Bointon | ||
* @copyright 2012 - 2020 Marcus Bointon | ||
* @copyright 2010 - 2012 Jim Jagielski | ||
* @copyright 2004 - 2009 Andy Prevost | ||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @author Jim Jagielski (jimjag) <[email protected]> | ||
* @author Andy Prevost (codeworxtech) <[email protected]> | ||
* @author Brent R. Matzelle (original founder) | ||
* @copyright 2012 - 2015 Marcus Bointon | ||
* @copyright 2012 - 2020 Marcus Bointon | ||
* @copyright 2010 - 2012 Jim Jagielski | ||
* @copyright 2004 - 2009 Andy Prevost | ||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @author Jim Jagielski (jimjag) <[email protected]> | ||
* @author Andy Prevost (codeworxtech) <[email protected]> | ||
* @author Brent R. Matzelle (original founder) | ||
* @copyright 2012 - 2019 Marcus Bointon | ||
* @copyright 2012 - 2020 Marcus Bointon | ||
* @copyright 2010 - 2012 Jim Jagielski | ||
* @copyright 2004 - 2009 Andy Prevost | ||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License | ||
|
@@ -747,7 +747,7 @@ class PHPMailer | |
* | ||
* @var string | ||
*/ | ||
const VERSION = '6.1.7'; | ||
const VERSION = '6.1.8'; | ||
|
||
/** | ||
* Error severity: message only, continue processing. | ||
|
@@ -899,6 +899,7 @@ protected function edebug($str) | |
switch ($this->Debugoutput) { | ||
case 'error_log': | ||
//Don't output, just log | ||
/** @noinspection ForgottenDebugOutputInspection */ | ||
error_log($str); | ||
break; | ||
case 'html': | ||
|
@@ -1350,7 +1351,7 @@ public static function validateAddress($address, $patternselect = null) | |
/* | ||
* This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. | ||
* | ||
* @see http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) | ||
* @see https://html.spec.whatwg.org/#e-mail-state-(type=email) | ||
*/ | ||
return (bool) preg_match( | ||
'/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . | ||
|
@@ -1609,6 +1610,9 @@ public function postSend() | |
return $this->mailSend($this->MIMEHeader, $this->MIMEBody); | ||
} | ||
} catch (Exception $exc) { | ||
if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true) { | ||
$this->smtp->reset(); | ||
} | ||
$this->setError($exc->getMessage()); | ||
$this->edebug($exc->getMessage()); | ||
if ($this->exceptions) { | ||
|
@@ -1749,6 +1753,23 @@ protected static function isPermittedPath($path) | |
return !preg_match('#^[a-z]+://#i', $path); | ||
} | ||
|
||
/** | ||
* Check whether a file path is safe, accessible, and readable. | ||
* | ||
* @param string $path A relative or absolute path to a file | ||
* | ||
* @return bool | ||
*/ | ||
protected static function fileIsAccessible($path) | ||
{ | ||
$readable = file_exists($path); | ||
//If not a UNC path (expected to start with \\), check read permission, see #2069 | ||
if (strpos($path, '\\\\') !== 0) { | ||
$readable = $readable && is_readable($path); | ||
} | ||
return static::isPermittedPath($path) && $readable; | ||
} | ||
|
||
/** | ||
* Send mail using the PHP mail() function. | ||
* | ||
|
@@ -2002,7 +2023,12 @@ public function smtpConnect($options = null) | |
} | ||
$host = $hostinfo[2]; | ||
$port = $this->Port; | ||
if (array_key_exists(3, $hostinfo) && is_numeric($hostinfo[3]) && $hostinfo[3] > 0 && $hostinfo[3] < 65536) { | ||
if ( | ||
array_key_exists(3, $hostinfo) && | ||
is_numeric($hostinfo[3]) && | ||
$hostinfo[3] > 0 && | ||
$hostinfo[3] < 65536 | ||
) { | ||
$port = (int) $hostinfo[3]; | ||
} | ||
if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { | ||
|
@@ -2132,7 +2158,7 @@ public function setLanguage($langcode = 'en', $lang_path = '') | |
// There is no English translation file | ||
if ('en' !== $langcode) { | ||
// Make sure language file path is readable | ||
if (!static::isPermittedPath($lang_file) || !file_exists($lang_file)) { | ||
if (!static::fileIsAccessible($lang_file)) { | ||
$foundlang = false; | ||
} else { | ||
// Overwrite language-specific strings. | ||
|
@@ -2380,21 +2406,18 @@ public function createHeader() | |
|
||
$result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate); | ||
|
||
// To be created automatically by mail() | ||
if ($this->SingleTo) { | ||
if ('mail' !== $this->Mailer) { | ||
// The To header is created automatically by mail(), so needs to be omitted here | ||
if ('mail' !== $this->Mailer) { | ||
if ($this->SingleTo) { | ||
foreach ($this->to as $toaddr) { | ||
$this->SingleToArray[] = $this->addrFormat($toaddr); | ||
} | ||
} | ||
} elseif (count($this->to) > 0) { | ||
if ('mail' !== $this->Mailer) { | ||
} elseif (count($this->to) > 0) { | ||
$result .= $this->addrAppend('To', $this->to); | ||
} elseif (count($this->cc) === 0) { | ||
$result .= $this->headerLine('To', 'undisclosed-recipients:;'); | ||
} | ||
} elseif (count($this->cc) === 0) { | ||
$result .= $this->headerLine('To', 'undisclosed-recipients:;'); | ||
} | ||
|
||
$result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]); | ||
|
||
// sendmail and mail() extract Cc from the header before sending | ||
|
@@ -2949,7 +2972,7 @@ public function textLine($value) | |
* @param string $path Path to the attachment | ||
* @param string $name Overrides the attachment name | ||
* @param string $encoding File encoding (see $Encoding) | ||
* @param string $type File extension (MIME) type | ||
* @param string $type MIME type, e.g. `image/jpeg`; determined automatically from $path if not specified | ||
* @param string $disposition Disposition to use | ||
* | ||
* @throws Exception | ||
|
@@ -2964,7 +2987,7 @@ public function addAttachment( | |
$disposition = 'attachment' | ||
) { | ||
try { | ||
if (!static::isPermittedPath($path) || !@is_file($path) || !is_readable($path)) { | ||
if (!static::fileIsAccessible($path)) { | ||
throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); | ||
} | ||
|
||
|
@@ -3138,7 +3161,7 @@ protected function attachAll($disposition_type, $boundary) | |
protected function encodeFile($path, $encoding = self::ENCODING_BASE64) | ||
{ | ||
try { | ||
if (!static::isPermittedPath($path) || !file_exists($path) || !is_readable($path)) { | ||
if (!static::fileIsAccessible($path)) { | ||
throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); | ||
} | ||
$file_buffer = file_get_contents($path); | ||
|
@@ -3524,7 +3547,7 @@ public function addEmbeddedImage( | |
$disposition = 'inline' | ||
) { | ||
try { | ||
if (!static::isPermittedPath($path) || !@is_file($path) || !is_readable($path)) { | ||
if (!static::fileIsAccessible($path)) { | ||
throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); | ||
} | ||
|
||
|
@@ -4215,6 +4238,7 @@ public static function _mime_types($ext = '') | |
'tiff' => 'image/tiff', | ||
'tif' => 'image/tiff', | ||
'webp' => 'image/webp', | ||
'avif' => 'image/avif', | ||
'heif' => 'image/heif', | ||
'heifs' => 'image/heif-sequence', | ||
'heic' => 'image/heic', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @author Jim Jagielski (jimjag) <[email protected]> | ||
* @author Andy Prevost (codeworxtech) <[email protected]> | ||
* @author Brent R. Matzelle (original founder) | ||
* @copyright 2012 - 2019 Marcus Bointon | ||
* @copyright 2012 - 2020 Marcus Bointon | ||
* @copyright 2010 - 2012 Jim Jagielski | ||
* @copyright 2004 - 2009 Andy Prevost | ||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License | ||
|
@@ -45,7 +45,7 @@ class POP3 | |
* | ||
* @var string | ||
*/ | ||
const VERSION = '6.1.7'; | ||
const VERSION = '6.1.8'; | ||
|
||
/** | ||
* Default POP3 port number. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @author Jim Jagielski (jimjag) <[email protected]> | ||
* @author Andy Prevost (codeworxtech) <[email protected]> | ||
* @author Brent R. Matzelle (original founder) | ||
* @copyright 2012 - 2019 Marcus Bointon | ||
* @copyright 2012 - 2020 Marcus Bointon | ||
* @copyright 2010 - 2012 Jim Jagielski | ||
* @copyright 2004 - 2009 Andy Prevost | ||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License | ||
|
@@ -34,7 +34,7 @@ class SMTP | |
* | ||
* @var string | ||
*/ | ||
const VERSION = '6.1.7'; | ||
const VERSION = '6.1.8'; | ||
|
||
/** | ||
* SMTP line break constant. | ||
|
@@ -417,8 +417,8 @@ protected function getSMTPConnection($host, $port = null, $timeout = 30, $option | |
// Windows does not have support for this timeout function | ||
if (strpos(PHP_OS, 'WIN') !== 0) { | ||
$max = (int)ini_get('max_execution_time'); | ||
// Don't bother if unlimited | ||
if (0 !== $max && $timeout > $max) { | ||
// Don't bother if unlimited, or if set_time_limit is disabled | ||
if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) { | ||
@set_time_limit($timeout); | ||
} | ||
stream_set_timeout($connection, $timeout, 0); | ||
|