From 1b7df89e9330f2b6098ecbd8072ff1661e0535d2 Mon Sep 17 00:00:00 2001 From: whyisjake Date: Tue, 8 Jun 2021 22:21:57 +0000 Subject: [PATCH] Administration: Escape the values of data-colname. Adds a `esc_attr` wrapper to `strip_all_tags`. See [33016]. Fixes #40401. Props rellect, SergeyBiryukov, hareesh-pillai, audrasjb. Built from https://develop.svn.wordpress.org/trunk@51115 git-svn-id: http://core.svn.wordpress.org/trunk@50724 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-list-table.php | 4 ++-- wp-admin/includes/class-wp-users-list-table.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 8169a4fcbc..535f5d5f81 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -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"; diff --git a/wp-admin/includes/class-wp-users-list-table.php b/wp-admin/includes/class-wp-users-list-table.php index 2ab7e9f725..a0a989498c 100644 --- a/wp-admin/includes/class-wp-users-list-table.php +++ b/wp-admin/includes/class-wp-users-list-table.php @@ -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"; diff --git a/wp-includes/version.php b/wp-includes/version.php index 3c3bc67d7b..6c0e8509e5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-51114'; +$wp_version = '5.8-alpha-51115'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.