From e6ede5ad5da8c81cc08092008b8b6890ebe76c0e Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Mon, 19 Aug 2024 18:00:15 +0530 Subject: [PATCH] Update formatting.php esc_textarea function is being passed a null value, and the htmlspecialchars() function within it expects a string, not null. This is reason getting the deprecation warning in PHP. --- src/wp-includes/formatting.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index e618536f41a20..2ce0a72cc40cd 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -4717,6 +4717,7 @@ function esc_attr( $text ) { * @return string */ function esc_textarea( $text ) { + $text = (string) $text; $safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) ); /** * Filters a string cleaned and escaped for output in a textarea element.