WordPress.org

Make WordPress Core

Ticket #43280: 43280.4.diff

File 43280.4.diff, 1.2 KB (added by welcher, 15 months ago)

Removes needless parameter from tests setup

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

    diff --git src/wp-includes/widgets/class-wp-widget-media-image.php src/wp-includes/widgets/class-wp-widget-media-image.php
    index 2b9bff221b..a0359bcbfd 100644
    class WP_Widget_Media_Image extends WP_Widget_Media { 
    261261                                $link .= sprintf( ' rel="%s"', esc_attr( $instance['link_rel'] ) );
    262262                        }
    263263                        if ( ! empty( $instance['link_target_blank'] ) ) {
     264                                if ( empty( $instance['link_rel'] ) ) {
     265                                        $link .= ' rel="noopener noreferrer"';
     266                                }
    264267                                $link .= ' target="_blank"';
    265268                        }
    266269                        $link .= '>';
  • tests/phpunit/tests/widgets/media-image-widget.php

    diff --git tests/phpunit/tests/widgets/media-image-widget.php tests/phpunit/tests/widgets/media-image-widget.php
    index e138f3e796..78d55fc09d 100644
    class Test_WP_Widget_Media_Image extends WP_UnitTestCase { 
    509509
    510510                $this->assertContains( '<a href="https://example.org"', $output );
    511511                $this->assertContains( 'target="_blank"', $output );
     512                $this->assertContains( 'rel="noopener noreferrer"', $output );
    512513
    513514                // Populate caption in attachment.
    514515                wp_update_post(