From e5cfe54261c432b56621aff7ea6f1dc9974d907e Mon Sep 17 00:00:00 2001 From: Harish Tewari <42291682+tewariharish@users.noreply.github.com> Date: Sat, 9 May 2026 17:33:22 +0530 Subject: [PATCH] Update formatting.php --- src/wp-includes/formatting.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 498d676f5c20f..40f570513a714 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -2279,6 +2279,9 @@ function sanitize_title_for_query( $title ) { * @return string The sanitized title. */ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'display' ) { + if ( ! is_string( $title ) ) { + return ''; + } $title = strip_tags( $title ); // Preserve escaped octets. $title = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title );