diff --git a/ldap_servers/LdapServer.class.php b/ldap_servers/LdapServer.class.php
index 48ecb71..8c8cbf8 100644
--- a/ldap_servers/LdapServer.class.php
+++ b/ldap_servers/LdapServer.class.php
@@ -277,6 +277,7 @@ class LdapServer {
 
     switch ($scope) {
       case LDAP_SCOPE_SUBTREE:
+        $filter = str_replace("\\","\\5c",$filter);
         $result = ldap_search($this->connection, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref);
         if ($this->hasError()) {
           watchdog('ldap_server', 'ldap_search() function error. LDAP Error: %message, ldap_search() parameters: %query',
