Make WordPress Core

Changeset 51975


Ignore:
Timestamp:
11/02/2021 03:56:02 PM (2 years ago)
Author:
johnjamesjacoby
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-comments.php

    r51475 r51975  
    252252        /* translators: %s: Search query. */
    253253        __( 'Search results for: %s' ),
    254         '<strong>' . wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' ) . '</strong>'
     254        '<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>'
    255255    );
    256256    echo '</span>';
Note: See TracChangeset for help on using the changeset viewer.