Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/JETPACK-1146
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Scan: Replace inline onclick handler with target="_blank" for CSP compliance in admin bar notice.
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ public function add_threats_to_toolbar( $wp_admin_bar ) {
);

if ( $has_threats ) {
$node['href'] = esc_url( Redirect::get_url( 'calypso-scanner' ) );
$node['meta']['onclick'] = 'window.open( this.href ); return false;';
$node['meta']['class'] = 'error';
$node['title'] = sprintf(
$node['href'] = esc_url( Redirect::get_url( 'calypso-scanner' ) );
$node['meta']['target'] = '_blank';
$node['meta']['rel'] = 'noopener noreferrer';
$node['meta']['class'] = 'error';
$node['title'] = sprintf(
esc_html(
/* translators: %s is the alert icon */
_n( '%s Threat found', '%s Threats found', $this->get_threat_count(), 'jetpack' )
Expand Down
Loading