Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request zendframework/zendframework#2109 from ethanhann/ma…
Browse files Browse the repository at this point in the history
…ster

Fix "ErrorHandler already started" exception
  • Loading branch information
Maks3w committed Aug 5, 2012
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -904,17 +904,18 @@ public function search($filter, $basedn = null, $scope = self::SEARCH_SCOPE_SUB,
$filter = $filter->toString();
}

$resource = $this->getResource();
ErrorHandler::start(E_WARNING);
switch ($scope) {
case self::SEARCH_SCOPE_ONE:
$search = ldap_list($this->getResource(), $basedn, $filter, $attributes, 0, $sizelimit, $timelimit);
$search = ldap_list($resource, $basedn, $filter, $attributes, 0, $sizelimit, $timelimit);
break;
case self::SEARCH_SCOPE_BASE:
$search = ldap_read($this->getResource(), $basedn, $filter, $attributes, 0, $sizelimit, $timelimit);
$search = ldap_read($resource, $basedn, $filter, $attributes, 0, $sizelimit, $timelimit);
break;
case self::SEARCH_SCOPE_SUB:
default:
$search = ldap_search($this->getResource(), $basedn, $filter, $attributes, 0, $sizelimit, $timelimit);
$search = ldap_search($resource, $basedn, $filter, $attributes, 0, $sizelimit, $timelimit);
break;
}
ErrorHandler::stop();
Expand Down

0 comments on commit d00b2c8

Please sign in to comment.