Skip to content

Commit 703c676

Browse files
committed
fixup! Log LDAP requests
1 parent 64ff185 commit 703c676

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

apps/user_ldap/lib/LDAP.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,23 @@ protected function invokeLDAPMethod() {
349349
* @param array $args
350350
*/
351351
private function preFunctionCall($functionName, $args) {
352+
$this->curFunc = $functionName;
353+
$this->curArgs = $args;
352354
if ($this->logFile !== '') {
355+
$args = array_reduce($this->curArgs, function (array $carry, $item): array {
356+
if (!is_resource($item)) {
357+
$carry[] = $item;
358+
}
359+
return $carry;
360+
}, []);
353361
file_put_contents(
354362
$this->logFile,
355-
$this->curFunc . '::' . json_encode($this->curArgs) . "\n",
363+
$this->curFunc . '::' . json_encode($args) . "\n",
356364
FILE_APPEND
357365
);
358366
}
359367

360-
$this->curFunc = $functionName;
361-
$this->curArgs = $args;
368+
362369
}
363370

364371
/**

0 commit comments

Comments
 (0)