Skip to content

Commit

Permalink
fixup! Fix some issues with the ldap data extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlSchwan committed Mar 30, 2022
1 parent 4884390 commit fc76c5c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions apps/user_ldap/lib/LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,19 +320,13 @@ private function preFunctionCall(string $functionName, array $args): void {
$this->curArgs = $args;

if ($this->dataCollector !== null) {
$args = array_reduce($this->curArgs, function (array $carry, $item): array {
$carry[] = !$this->isResource($item) ? $item : '(resource)';
return $carry;
}, []);
$args = array_map(fn (item) => (!$this->isResource($item) ? $item : '(resource)'), $this->curArgs);

$this->dataCollector->startLdapRequest($this->curFunc, $args);
}

if ($this->logFile !== '' && is_writable(dirname($this->logFile)) && (!file_exists($this->logFile) || is_writable($this->logFile))) {
$args = array_reduce($this->curArgs, function (array $carry, $item): array {
$carry[] = !$this->isResource($item) ? $item : '(resource)';
return $carry;
}, []);
$args = array_map(fn (item) => (!$this->isResource($item) ? $item : '(resource)'), $this->curArgs);
file_put_contents(
$this->logFile,
$this->curFunc . '::' . json_encode($args) . "\n",
Expand Down

0 comments on commit fc76c5c

Please sign in to comment.