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

Commit

Permalink
Merge pull request #156 from slaci/issue-155
Browse files Browse the repository at this point in the history
#155 fix exception handling for ZendDriver
  • Loading branch information
Maks3w authored Mar 20, 2019
2 parents 82d21ac + e476fce commit 2309156
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Driver/ZendLdapDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace FR3D\LdapBundle\Driver;

use FR3D\LdapBundle\Exception\SanitizingException;
use FR3D\LdapBundle\Model\LdapUserInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Zend\Ldap\Exception\LdapException as ZendLdapException;
use Zend\Ldap\Ldap;
use FR3D\LdapBundle\Exception\SanitizingException;

/**
* This class adapt ldap calls to Zend Framework Ldap library functions.
Expand Down Expand Up @@ -94,10 +94,11 @@ public function bind(UserInterface $user, $password)
* Treat a Zend Ldap Exception.
*
* @param ZendLdapException $exception
* @param string $password
*/
protected function zendExceptionHandler(ZendLdapException $exception, $password)
protected function zendExceptionHandler(ZendLdapException $exception, $password = null)
{
$sanitizedException = new SanitizingException($exception, $password);
$sanitizedException = null !== $password ? new SanitizingException($exception, $password) : $exception;

switch ($exception->getCode()) {
// Error level codes
Expand Down

0 comments on commit 2309156

Please sign in to comment.