diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-08-04 23:22:57 -0700 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-08-04 23:22:57 -0700 |
commit | 17239fa5224cefb7e32665719461beaaf5e52017 (patch) | |
tree | e783b35a3910d8acd5c3780949734869d4e6e6f6 /program/lib/Roundcube | |
parent | ce5a6496fd6039962ba7424d153278e41ae8761b (diff) | |
parent | d52a77a10d7eb0ea36543e59a11a6704f20f8605 (diff) |
Merge pull request #100 from Dennis1993/patch-8
Remove sensless version_compare()
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r-- | program/lib/Roundcube/rcube_imap_generic.php | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index 45eb0311f..e1193749b 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -800,23 +800,21 @@ class rcube_imap_generic // TLS connection if ($this->prefs['ssl_mode'] == 'tls' && $this->getCapability('STARTTLS')) { - if (version_compare(PHP_VERSION, '5.1.0', '>=')) { - $res = $this->execute('STARTTLS'); + $res = $this->execute('STARTTLS'); - if ($res[0] != self::ERROR_OK) { - $this->closeConnection(); - return false; - } - - if (!stream_socket_enable_crypto($this->fp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { - $this->setError(self::ERROR_BAD, "Unable to negotiate TLS"); - $this->closeConnection(); - return false; - } + if ($res[0] != self::ERROR_OK) { + $this->closeConnection(); + return false; + } - // Now we're secure, capabilities need to be reread - $this->clearCapability(); + if (!stream_socket_enable_crypto($this->fp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { + $this->setError(self::ERROR_BAD, "Unable to negotiate TLS"); + $this->closeConnection(); + return false; } + + // Now we're secure, capabilities need to be reread + $this->clearCapability(); } // Send ID info |