Skip to content

Commit 708e1ca

Browse files
committed
Merge pull request #324 from thomasgriffin/feature/escape-some-more
Escape some more output
2 parents e8f1b7c + 4f8ae29 commit 708e1ca

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

class-tgm-plugin-activation.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ public function notices() {
752752
$source = $this->_get_plugin_data_from_name( $plugin_group_single_name, 'source' );
753753

754754
if ( $external_url && preg_match( '|^http(s)?://|', $external_url ) ) {
755-
$linked_plugin_groups[] = '<a href="' . esc_url( $external_url ) . '" target="_blank">' . $plugin_group_single_name . '</a>';
755+
$linked_plugin_groups[] = '<a href="' . esc_url( $external_url ) . '" target="_blank">' . esc_html( $plugin_group_single_name ) . '</a>';
756756
}
757757
elseif ( ! $source || preg_match( '|^http://wordpress.org/extend/plugins/|', $source ) ) {
758758
$url = add_query_arg(
@@ -766,7 +766,7 @@ public function notices() {
766766
self_admin_url( 'plugin-install.php' )
767767
);
768768

769-
$linked_plugin_groups[] = '<a href="' . esc_url( $url ) . '" class="thickbox">' . $plugin_group_single_name . '</a>';
769+
$linked_plugin_groups[] = '<a href="' . esc_url( $url ) . '" class="thickbox">' . esc_html( $plugin_group_single_name ) . '</a>';
770770
}
771771
else {
772772
$linked_plugin_groups[] = $plugin_group_single_name; // No hyperlink.
@@ -793,7 +793,7 @@ public function notices() {
793793
array(
794794
'install' => ( current_user_can( 'install_plugins' ) ) ? $show_install_link : '',
795795
'activate' => ( current_user_can( 'activate_plugins' ) ) ? $show_activate_link : '',
796-
'dismiss' => $this->dismissable ? '<a class="dismiss-notice" href="' . esc_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ) ) . '" target="_parent">' . $this->strings['dismiss'] . '</a>' : '',
796+
'dismiss' => $this->dismissable ? '<a class="dismiss-notice" href="' . esc_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ) ) . '" target="_parent">' . esc_html( $this->strings['dismiss'] ) . '</a>' : '',
797797
)
798798
);
799799

@@ -1251,7 +1251,7 @@ protected function _gather_plugin_data() {
12511251
$source = $this->_get_plugin_data_from_name( $plugin['name'], 'source' );
12521252

12531253
if ( $external_url && preg_match( '|^http(s)?://|', $external_url ) ) {
1254-
$table_data[ $i ]['plugin'] = '<strong><a href="' . esc_url( $external_url ) . '" target="_blank">' . $plugin['name'] . '</a></strong>';
1254+
$table_data[ $i ]['plugin'] = '<strong><a href="' . esc_url( $external_url ) . '" target="_blank">' . esc_html( $plugin['name'] ) . '</a></strong>';
12551255
}
12561256
elseif ( ! $source || preg_match( '|^http://wordpress.org/extend/plugins/|', $source ) ) {
12571257
$url = add_query_arg(
@@ -1265,7 +1265,7 @@ protected function _gather_plugin_data() {
12651265
self_admin_url( 'plugin-install.php' )
12661266
);
12671267

1268-
$table_data[ $i ]['plugin'] = '<strong><a href="' . esc_url( $url ) . '" class="thickbox">' . $plugin['name'] . '</a></strong>';
1268+
$table_data[ $i ]['plugin'] = '<strong><a href="' . esc_url( $url ) . '" class="thickbox">' . esc_html( $plugin['name'] ) . '</a></strong>';
12691269
}
12701270
else {
12711271
$table_data[ $i ]['plugin'] = '<strong>' . $plugin['name'] . '</strong>'; // No hyperlink.
@@ -1413,9 +1413,9 @@ public function column_plugin( $item ) {
14131413

14141414
$actions = array(
14151415
'install' => sprintf(
1416-
'<a href="%1$s">' . esc_attr_x( 'Install %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ) . '</a>',
1416+
'<a href="%1$s">' . esc_html_x( 'Install %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ) . '</a>',
14171417
esc_url( $install_nonce_url ),
1418-
'<span class="screen-reader-text">' . $item['sanitized_plugin'] . '</span>'
1418+
'<span class="screen-reader-text">' . esc_html( $item['sanitized_plugin'] ) . '</span>'
14191419
),
14201420
);
14211421
}
@@ -1435,9 +1435,9 @@ public function column_plugin( $item ) {
14351435

14361436
$actions = array(
14371437
'activate' => sprintf(
1438-
'<a href="%1$s">' . esc_attr_x( 'Activate %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ) . '</a>',
1438+
'<a href="%1$s">' . esc_html_x( 'Activate %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ) . '</a>',
14391439
esc_url( $activate_url ),
1440-
'<span class="screen-reader-text">' . $item['sanitized_plugin'] . '</span>'
1440+
'<span class="screen-reader-text">' . esc_html( $item['sanitized_plugin'] ) . '</span>'
14411441
),
14421442
);
14431443
}
@@ -1471,7 +1471,7 @@ public function column_cb( $item ) {
14711471
$plugin_url = urlencode( $plugin_url );
14721472
}
14731473

1474-
$value = $item['file_path'] . ',' . $plugin_url . ',' . $item['sanitized_plugin'];
1474+
$value = $item['file_path'] . ',' . $plugin_url . ',' . $item['sanitized_plugin'];
14751475
return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" id="%3$s" />', esc_attr( $this->_args['singular'] ), esc_attr( $value ), esc_attr( $item['sanitized_plugin'] ) );
14761476

14771477
}

0 commit comments

Comments
 (0)