Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/wp-admin/includes/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,9 @@ function wp_plugin_update_row( $file, $plugin_data ) {
'em' => array(),
'strong' => array(),
);
$plugin_display_name = '<strong>' . wp_kses( $plugin_data['Name'], $plugins_allowedtags ) . '</strong>';

$plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
$plugin_name = strip_tags( $plugin_display_name );
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use wp_strip_all_tags(), but I chose the simpler function because the name already ran through wp_kses().

$plugin_slug = $response->slug ?? $response->id;

if ( isset( $response->slug ) ) {
Expand Down Expand Up @@ -524,41 +525,41 @@ function wp_plugin_update_row( $file, $plugin_data ) {
printf(
/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number. */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),
$plugin_name,
$plugin_display_name,
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Plugin name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
),
esc_attr( $response->new_version )
esc_html( $response->new_version )
);
} elseif ( empty( $response->package ) ) {
printf(
/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number. */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
$plugin_name,
$plugin_display_name,
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Plugin name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
),
esc_attr( $response->new_version )
esc_html( $response->new_version )
);
} else {
if ( $compatible_php ) {
printf(
/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number, 5: Update URL, 6: Additional link attributes. */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ),
$plugin_name,
$plugin_display_name,
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Plugin name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
),
esc_attr( $response->new_version ),
esc_html( $response->new_version ),
wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),
sprintf(
'class="update-link" aria-label="%s"',
Expand All @@ -570,14 +571,14 @@ function wp_plugin_update_row( $file, $plugin_data ) {
printf(
/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number 5: URL to Update PHP page. */
__( 'There is a new version of %1$s available, but it does not work with your version of PHP. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s">learn more about updating PHP</a>.' ),
$plugin_name,
$plugin_display_name,
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Plugin name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
),
esc_attr( $response->new_version ),
esc_html( $response->new_version ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '<br><em>', '</em>' );
Expand Down
Loading