]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix profiler trying to serialize invalid utf8 32910/head
authorCarl Schwan <carl@carlschwan.eu>
Fri, 17 Jun 2022 08:23:03 +0000 (10:23 +0200)
committerCarl Schwan <carl@carlschwan.eu>
Mon, 20 Jun 2022 09:11:12 +0000 (11:11 +0200)
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>
apps/user_ldap/lib/LDAP.php

index 3c5795969417330b2b12830b9da86a976f388a7d..545a09ca4641b511a4f4f17dd93bb01c67dcc52d 100644 (file)
@@ -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);
                }