nextcloud / user_external

👥 External user authentication methods like IMAP, SMB and FTP
https://apps.nextcloud.com/apps/user_external
107 stars 64 forks source link

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

Closed VVD closed 1 year ago

VVD commented 2 years ago

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 commented 1 year ago

ping

violoncelloCH commented 1 year ago

hey, would you mind submitting your patch as a Pull Request ? :)

Popyllol commented 1 year ago

This patch works fine for me as well!

Version of Nextcloud: 25.0.2.3

VVD commented 1 year ago

hey, would you mind submitting your patch as a Pull Request ? :)

Hello! I can't do - this operation require fork of all repository for 1 line (4 letters) patch. :-o Just get it from text, plz. [-8

Glandos commented 1 year ago

PR submitted. Via GitHub web interface only ;)

VVD commented 1 year ago

PR submitted. Via GitHub web interface only ;)

Thanks!

Waiting release now.