summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-06-17 10:23:03 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-06-20 10:57:42 +0000
commit6beddbc163d92dbe3106808d9e70005c9b598bad (patch)
tree6b16ffaa06c086da3852b3b5c74ee0768a02a71a
parent7820bd2ff5b1359afe7617fb21fe44fabf824932 (diff)
downloadnextcloud-server-6beddbc163d92dbe3106808d9e70005c9b598bad.tar.gz
nextcloud-server-6beddbc163d92dbe3106808d9e70005c9b598bad.zip
Fix profiler trying to serialize invalid utf8
The cookie value contains invalid utf8 characters most of the time so let's just ignore it as it is also not that interesting to analyse. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r--apps/user_ldap/lib/LDAP.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index 3c579596941..545a09ca464 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -320,7 +320,15 @@ class LDAP implements ILDAPWrapper {
$this->curArgs = $args;
if ($this->dataCollector !== null) {
- $args = array_map(fn ($item) => (!$this->isResource($item) ? $item : '(resource)'), $this->curArgs);
+ $args = array_map(function ($item) {
+ if ($this->isResource($item)) {
+ return '(resource)';
+ }
+ if (isset($item[0]['value']['cookie']) && $item[0]['value']['cookie'] !== "") {
+ $item[0]['value']['cookie'] = "*opaque cookie*";
+ }
+ return $item;
+ }, $this->curArgs);
$this->dataCollector->startLdapRequest($this->curFunc, $args);
}