From 0a5088758e4da6b80982f4fee16c48e7cc0e2fcc Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 10 Jun 2014 11:57:05 +0200 Subject: Fix "PHP Fatal error: Cannot break/continue 1 level" when ldap_start_tls() fails --- program/lib/Roundcube/rcube_ldap_generic.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'program/lib/Roundcube/rcube_ldap_generic.php') diff --git a/program/lib/Roundcube/rcube_ldap_generic.php b/program/lib/Roundcube/rcube_ldap_generic.php index 16b7fdaca..1cd0b5a21 100644 --- a/program/lib/Roundcube/rcube_ldap_generic.php +++ b/program/lib/Roundcube/rcube_ldap_generic.php @@ -175,9 +175,11 @@ class rcube_ldap_generic $this->_debug("C: Connect to $hostname [{$this->config['name']}]"); if ($lc = @ldap_connect($host, $this->config['port'])) { - if ($this->config['use_tls'] === true) - if (!ldap_start_tls($lc)) - continue; + if ($this->config['use_tls'] === true) { + if (!ldap_start_tls($lc)) { + return false; + } + } $this->_debug("S: OK"); @@ -186,7 +188,7 @@ class rcube_ldap_generic $this->conn = $lc; if (!empty($this->config['network_timeout'])) - ldap_set_option($lc, LDAP_OPT_NETWORK_TIMEOUT, $this->config['network_timeout']); + ldap_set_option($lc, LDAP_OPT_NETWORK_TIMEOUT, $this->config['network_timeout']); if (isset($this->config['referrals'])) ldap_set_option($lc, LDAP_OPT_REFERRALS, $this->config['referrals']); -- cgit v1.2.3