From 3c9a1a3c2c9b065c95f96496af4f000304898691 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Thu, 4 Jan 2018 12:19:16 +0100
Subject: [PATCH] Fix mistake

---
 lib/SimpleSAML/Auth/LDAP.php | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php
index 56fcc70b0..005294c98 100644
--- a/lib/SimpleSAML/Auth/LDAP.php
+++ b/lib/SimpleSAML/Auth/LDAP.php
@@ -107,7 +107,7 @@ class SimpleSAML_Auth_LDAP
         }
 
         // Enable TLS, if needed
-        if (stripos($hostname, "ldaps:") === false and $enable_tls) {
+        if (stripos($hostname, "ldaps:") === false && $enable_tls) {
             if (!@ldap_start_tls($this->ldap)) {
                 throw $this->makeException('Library - LDAP __construct(): Unable to force TLS', ERR_INTERNAL);
             }
@@ -427,8 +427,6 @@ class SimpleSAML_Auth_LDAP
      */
     public function bind($dn, $password, array $sasl_args = null)
     {
-        $authz_id = null;
-
         if ($sasl_args != null) {
             if (!function_exists('ldap_sasl_bind')) {
                 $ex_msg = 'Library - missing SASL support';
@@ -736,6 +734,7 @@ class SimpleSAML_Auth_LDAP
      */
     public function whoami($searchBase, $searchAttributes)
     {
+        $authz_id = '';
         if (function_exists('ldap_exop_whoami')) {
             if (version_compare(phpversion(), '7', '<')) {
                 if (ldap_exop_whoami($this->ldap, $authz_id) !== true) {
-- 
GitLab