8000 bug #39094 [Ldap] Fix undefined variable $con (derrabus) · symfony/symfony@d6f27fa · GitHub
[go: up one dir, main page]

Skip to content

Commit d6f27fa

Browse files
committed
bug #39094 [Ldap] Fix undefined variable $con (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [Ldap] Fix undefined variable $con | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #39030 (comment) | License | MIT | Doc PR | N/A This PR extracts the connection resource into a variable. This will fix an undefined variable error on 5.1. Commits ------- 15da316 [Ldap] Fix undefined variable $con.
2 parents 55707fb + 15da316 commit d6f27fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ public function applyOperations(string $dn, iterable $operations): void
151151
$operationsMapped[] = $modification->toArray();
152152
}
153153

154-
if (!@ldap_modify_batch($this->getConnectionResource(), $dn, $operationsMapped)) {
155-
throw new UpdateOperationException(sprintf('Error executing UpdateOperation on "%s": "%s".', $dn, ldap_error($this->getConnectionResource())));
154+
$con = $this->getConnectionResource();
155+
if (!@ldap_modify_batch($con, $dn, $operationsMapped)) {
156+
throw new UpdateOperationException(sprintf('Error executing UpdateOperation on "%s": "%s".', $dn, ldap_error($con)));
156157
}
157158
}
158159

0 commit comments

Comments
 (0)
0