Opened 14 months ago
Closed 14 months ago
#56808 closed enhancement (duplicate)
adding null coalescing operator for rtrim function to avoid deprecation
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
There was a warning showing
Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/wordpress/wordpress/wp-includes/formatting.php on line 2872
The rtrim function 1st parameter value as null is deprecated in php 8.1. It can be fixed by adding
null coalescing
operator.
function untrailingslashit( $string ) { return rtrim( $string ?? '', '/\\' ); }
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Warning Screenshot