Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit 2309156

Browse files
authored
Merge pull request #156 from slaci/issue-155
#155 fix exception handling for ZendDriver
2 parents 82d21ac + e476fce commit 2309156

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Driver/ZendLdapDriver.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace FR3D\LdapBundle\Driver;
44

5+
use FR3D\LdapBundle\Exception\SanitizingException;
56
use FR3D\LdapBundle\Model\LdapUserInterface;
67
use Psr\Log\LoggerInterface;
78
use Symfony\Component\Security\Core\User\UserInterface;
89
use Zend\Ldap\Exception\LdapException as ZendLdapException;
910
use Zend\Ldap\Ldap;
10-
use FR3D\LdapBundle\Exception\SanitizingException;
1111

1212
/**
1313
* This class adapt ldap calls to Zend Framework Ldap library functions.
@@ -94,10 +94,11 @@ public function bind(UserInterface $user, $password)
9494
* Treat a Zend Ldap Exception.
9595
*
9696
* @param ZendLdapException $exception
97+
* @param string $password
9798
*/
98-
protected function zendExceptionHandler(ZendLdapException $exception, $password)
99+
protected function zendExceptionHandler(ZendLdapException $exception, $password = null)
99100
{
100-
$sanitizedException = new SanitizingException($exception, $password);
101+
$sanitizedException = null !== $password ? new SanitizingException($exception, $password) : $exception;
101102

102103
switch ($exception->getCode()) {
103104
// Error level codes

0 commit comments

Comments
 (0)