From 4923d75fb17bb3420e947073b5f7978a2781fba9 Mon Sep 17 00:00:00 2001 From: John James Jacoby Date: Tue, 2 Nov 2021 15:56:02 +0000 Subject: [PATCH] Admin/Comments: remove bespoke truncation from search string HTML. This change removes a call to `wp_html_excerpt()` used on the HTML output of the search string, supplied by the current user in the previous page request via the named `s` input in the search-box UI. If the search string is extremely long, it wraps around the available empty space in a way that is not visually displeasing, confirming that truncation is not a requirement here. This also addresses a small accessibility concern as the non-truncated string was not alternatively presented, and helps normalize the output of `$_REQUEST['s']` for more broad improvements in the future. Props hareesh-pillai, jakubtyrcha, johnjamesjacoby, lukecavanagh, sabernhardt. Fixes #17636. git-svn-id: https://develop.svn.wordpress.org/trunk@51975 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-comments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/edit-comments.php b/src/wp-admin/edit-comments.php index f54d0abd8f..ba8924f1e0 100644 --- a/src/wp-admin/edit-comments.php +++ b/src/wp-admin/edit-comments.php @@ -251,7 +251,7 @@ if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { printf( /* translators: %s: Search query. */ __( 'Search results for: %s' ), - '' . wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '…' ) . '' + '' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '' ); echo ''; }