Make WordPress Core

Ticket #43280: 43280.2.diff

File 43280.2.diff, 644 bytes (added by audrasjb, 7 years ago)

Adds both noopener and noreferrer values and refreshes the patch against trunk

  • src/wp-includes/widgets/class-wp-widget-media-image.php

    diff --git a/src/wp-includes/widgets/class-wp-widget-media-image.php b/src/wp-includes/widgets/class-wp-widget-media-image.php
    index 899b410..77c2864 100644
    a b class WP_Widget_Media_Image extends WP_Widget_Media { 
    257257                                $link .= sprintf( ' rel="%s"', esc_attr( $instance['link_rel'] ) );
    258258                        }
    259259                        if ( ! empty( $instance['link_target_blank'] ) ) {
     260                                if ( empty( $instance['link_rel'] ) ) {
     261                                        $link .= ' rel="noopener noreferrer"';
     262                                }
    260263                                $link .= ' target="_blank"';
    261264                        }
    262265                        $link .= '>';