summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-06-10 11:57:05 +0200
committerAleksander Machniak <alec@alec.pl>2014-06-10 11:57:05 +0200
commitf67d372449a358f72c9f8d654dadda014fccf293 (patch)
tree883c0d336ec05f177a42df61cc2eba075a5e0606 /program/lib/Roundcube
parent51cae1f5eca6d2e0d957be6f2476aa0898a266e0 (diff)
Fix "PHP Fatal error: Cannot break/continue 1 level" when ldap_start_tls() fails
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/rcube_ldap_generic.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/program/lib/Roundcube/rcube_ldap_generic.php b/program/lib/Roundcube/rcube_ldap_generic.php
index 252eafabe..25fe2e5d2 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']);