Avoid old aliases

Use short array syntax
This commit is contained in:
Marcus Bointon 2017-06-29 20:52:54 +02:00
parent 6d7c66df9e
commit 1f6c876d5e
2 changed files with 13 additions and 13 deletions

View File

@ -1461,9 +1461,9 @@ class PHPMailer
if (!$mail) {
throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
fputs($mail, 'To: ' . $toAddr . "\n");
fputs($mail, $header);
fputs($mail, $body);
fwrite($mail, 'To: ' . $toAddr . "\n");
fwrite($mail, $header);
fwrite($mail, $body);
$result = pclose($mail);
$this->doCallback(
($result == 0),
@ -1483,8 +1483,8 @@ class PHPMailer
if (!$mail) {
throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
fputs($mail, $header);
fputs($mail, $body);
fwrite($mail, $header);
fwrite($mail, $body);
$result = pclose($mail);
$this->doCallback(
($result == 0),
@ -1515,7 +1515,7 @@ class PHPMailer
{
// Future-proof
if (escapeshellcmd($string) !== $string
or !in_array(escapeshellarg($string), array("'$string'", "\"$string\""))
or !in_array(escapeshellarg($string), ["'$string'", "\"$string\""])
) {
return false;
}
@ -1841,13 +1841,13 @@ class PHPMailer
public function setLanguage($langcode = 'en', $lang_path = '')
{
// Backwards compatibility for renamed language codes
$renamed_langcodes = array(
$renamed_langcodes = [
'br' => 'pt_br',
'cz' => 'cs',
'dk' => 'da',
'no' => 'nb',
'se' => 'sv',
);
];
if (isset($renamed_langcodes[$langcode])) {
$langcode = $renamed_langcodes[$langcode];

View File

@ -288,7 +288,7 @@ class SMTP
$errstr = '';
if ($streamok) {
$socket_context = stream_context_create($options);
set_error_handler(array($this, 'errorHandler'));
set_error_handler([$this, 'errorHandler']);
$this->smtp_conn = stream_socket_client(
$host . ":" . $port,
$errno,
@ -304,7 +304,7 @@ class SMTP
"Connection: stream_socket_client not available, falling back to fsockopen",
self::DEBUG_CONNECTION
);
set_error_handler(array($this, 'errorHandler'));
set_error_handler([$this, 'errorHandler']);
$this->smtp_conn = fsockopen(
$host,
$port,
@ -367,7 +367,7 @@ class SMTP
}
// Begin encrypted connection
set_error_handler(array($this, 'errorHandler'));
set_error_handler([$this, 'errorHandler']);
$crypto_ok = stream_socket_enable_crypto(
$this->smtp_conn,
true,
@ -424,7 +424,7 @@ class SMTP
if (empty($authtype)) {
//If no auth mechanism is specified, attempt to use these, in this order
//Try CRAM-MD5 first as it's more secure than the others
foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'XOAUTH2') as $method) {
foreach (['CRAM-MD5', 'LOGIN', 'PLAIN', 'XOAUTH2'] as $method) {
if (in_array($method, $this->server_caps['AUTH'])) {
$authtype = $method;
break;
@ -959,7 +959,7 @@ class SMTP
public function client_send($data)
{
$this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
set_error_handler(array($this, 'errorHandler'));
set_error_handler([$this, 'errorHandler']);
$result = fwrite($this->smtp_conn, $data);
restore_error_handler();
return $result;