Commit 029a9044 authored by efalcy's avatar efalcy
Browse files

hotline #77270 : incompatibility php < 5.6

parent e8e89585
......@@ -228,8 +228,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
// If all is good, switch socket to secure mode. We have to fall back
// through the different modes
$modes = defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')
? array(
$modes = [
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT,
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT,
......@@ -237,13 +236,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
STREAM_CRYPTO_METHOD_SSLv23_CLIENT,
STREAM_CRYPTO_METHOD_SSLv2_CLIENT,
STREAM_CRYPTO_METHOD_ANY_CLIENT
)
: array(
STREAM_CRYPTO_METHOD_TLS_CLIENT,
STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
STREAM_CRYPTO_METHOD_SSLv23_CLIENT,
STREAM_CRYPTO_METHOD_SSLv2_CLIENT,
);
];
$success = false;
foreach($modes as $mode) {
......
......@@ -113,16 +113,11 @@ class Zend_Mail_Protocol_Imap
protected function _connectViaTLS() {
$success = false;
$modes = defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')
? array(
$modes = [
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT,
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT,
)
: array(
STREAM_CRYPTO_METHOD_TLS_CLIENT,
);
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
];
foreach($modes as $mode) {
$success = stream_socket_enable_crypto($this->_socket, true, $mode);
if ($success) return true;
......
......@@ -122,15 +122,11 @@ class Zend_Mail_Protocol_Pop3
protected function _connectViaTLS() {
$success = false;
$modes = defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')
? array(
$modes = [
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT,
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT,
)
: array(
STREAM_CRYPTO_METHOD_TLS_CLIENT,
);
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
];
foreach($modes as $mode) {
$success = stream_socket_enable_crypto($this->_socket, true, $mode);
......
......@@ -214,15 +214,11 @@ class Zend_Mail_Protocol_Smtp extends Zend_Mail_Protocol_Abstract
protected function _connectViaTLS() {
$success = false;
$modes = defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')
? array(
$modes = [
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT,
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT,
)
: array(
STREAM_CRYPTO_METHOD_TLS_CLIENT,
);
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
];
foreach($modes as $mode) {
$success = stream_socket_enable_crypto($this->_socket, true, $mode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment