[wp-trac] [WordPress Trac] #62070: PHP 8.1 PHP Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated

WordPress Trac noreply at wordpress.org
Thu Sep 19 05:46:04 UTC 2024


#62070: PHP 8.1 PHP Deprecated: trim(): Passing null to parameter #1 ($string) of
type string is deprecated
--------------------------+------------------------------
 Reporter:  dhruvang21    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  php-81 close  |     Focuses:
--------------------------+------------------------------

Comment (by dhruvang21):

 Hi @jrf,

 I believe the error isn't caused by any plugin or theme, as I've tested it
 across multiple themes and without any plugins installed. The problem
 appears to arise from passing null instead of an empty string in the
 authorize-application.php file at line 70, which is the source of the
 issue.

 To resolve this, I’ve attached a patch that changes null to an empty
 string, which fixes the error. If this patch looks appropriate, I’d be
 happy to commit the code.

 Thanks!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62070#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list