From 01d9d927a01821758293d59a14a3f86f7722984a Mon Sep 17 00:00:00 2001 From: narenin Date: Wed, 27 Nov 2024 18:01:05 +0530 Subject: [PATCH 1/2] Fixed rtrim() Passing null to parameter PHP deprecated Error --- src/wp-includes/formatting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index b579bcd324299..30ff47b46ff40 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -2816,7 +2816,7 @@ function trailingslashit( $value ) { * @return string String without the trailing slashes. */ function untrailingslashit( $value ) { - return rtrim( $value, '/\\' ); + return ! empty( $value ) && is_string( $value ) ? rtrim( $value, '/\\' ) : ''; } /** From 38e4547af004e0ac7066c70f94de93d65713ccf5 Mon Sep 17 00:00:00 2001 From: narenin Date: Wed, 27 Nov 2024 18:19:22 +0530 Subject: [PATCH 2/2] Fixed rtrim() Passing null to parameter PHP deprecated Error --- src/wp-includes/formatting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 30ff47b46ff40..754954b6ee365 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -2816,7 +2816,7 @@ function trailingslashit( $value ) { * @return string String without the trailing slashes. */ function untrailingslashit( $value ) { - return ! empty( $value ) && is_string( $value ) ? rtrim( $value, '/\\' ) : ''; + return ! empty( $value ) ? rtrim( $value, '/\\' ) : $value; } /**