user_external icon indicating copy to clipboard operation
user_external copied to clipboard

PHP 8.1 support: trim(): Passing null to parameter #1 ($string) of type string is deprecated at lib/Base.php#69

Open VVD opened this issue 3 years ago • 0 comments

Log:

trim(): Passing null to parameter #1 ($string) of type string is deprecated at /nextcloud/apps/user_external/lib/Base.php#69

Patch:

--- lib/Base.php
+++ lib/Base.php
@@ -66,7 +66,7 @@
                $user = $result->fetch();
                $result->closeCursor();
 
-               $displayName = trim($user['displayname'], ' ');
+               $displayName = trim($user['displayname'] ?? '', ' ');
                if (!empty($displayName)) {
                        return $displayName;
                } else {

VVD avatar Jun 27 '22 16:06 VVD