From 266e5c750c85ae4c87193678d209ed13344dc24b Mon Sep 17 00:00:00 2001
From: Matt Schwager <matts@duosecurity.com>
Date: Thu, 14 May 2015 10:36:07 -0400
Subject: [PATCH] Use stripos for speed improvments.

---
 lib/SimpleSAML/Auth/LDAP.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php
index 50cd5da52..db95377c4 100644
--- a/lib/SimpleSAML/Auth/LDAP.php
+++ b/lib/SimpleSAML/Auth/LDAP.php
@@ -100,7 +100,7 @@ class SimpleSAML_Auth_LDAP {
 		}
 
 		// Enable TLS, if needed.
-		if (!preg_match("/ldaps:/i", $hostname) and $enable_tls)
+		if (stripos($hostname, "ldaps:") === FALSE and $enable_tls)
 			if (!@ldap_start_tls($this->ldap))
 				throw $this->makeException('Library - LDAP __construct(): Unable to force TLS', ERR_INTERNAL);
 
-- 
GitLab