Administration: Escape the values of data-colname.

Adds a `esc_attr` wrapper to `strip_all_tags`.

See [33016].

Fixes .

Props rellect, SergeyBiryukov, hareesh-pillai, audrasjb.



git-svn-id: https://develop.svn.wordpress.org/trunk@51115 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jake Spurlock 2021-06-08 22:20:42 +00:00
parent fe1ef97ef3
commit 5001efad74
2 changed files with 3 additions and 3 deletions

@ -1425,8 +1425,8 @@ class WP_List_Table {
}
// Comments column uses HTML in the display name with screen reader text.
// Instead of using esc_attr(), we strip tags to get closer to a user-friendly string.
$data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
// Strip tags to get closer to a user-friendly string.
$data = 'data-colname="' . esc_attr( wp_strip_all_tags( $column_display_name ) ) . '"';
$attributes = "class='$classes' $data";

@ -531,7 +531,7 @@ class WP_Users_List_Table extends WP_List_Table {
$classes .= ' hidden';
}
$data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
$data = 'data-colname="' . esc_attr( wp_strip_all_tags( $column_display_name ) ) . '"';
$attributes = "class='$classes' $data";