Make WordPress Core

Ticket #47244: 47244-2.diff

File 47244-2.diff, 1.6 KB (added by birgire, 7 years ago)
  • src/wp-includes/widgets/class-wp-widget-custom-html.php

    diff --git src/wp-includes/widgets/class-wp-widget-custom-html.php src/wp-includes/widgets/class-wp-widget-custom-html.php
    index 93fb579..5d2b28a 100644
    class WP_Widget_Custom_HTML extends WP_Widget {  
    143143                /** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */
    144144                $content = apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this );
    145145
    146                 // Adds noreferrer and noopener relationships, without duplicating values, to all HTML A elements that have a target.
    147                 $content = wp_targeted_link_rel( $content );
    148 
    149146                /**
    150147                 * Filters the content of the Custom HTML widget.
    151148                 *
  • tests/phpunit/tests/widgets/custom-html-widget.php

    diff --git tests/phpunit/tests/widgets/custom-html-widget.php tests/phpunit/tests/widgets/custom-html-widget.php
    index 3a31a7d..9878c11 100644
    class Test_WP_Widget_Custom_HTML extends WP_UnitTestCase {  
    304304        }
    305305
    306306        /**
    307          * Ensure that rel="noopener noreferrer" is added to links with a target.
     307         * Ensure that rel="noopener noreferrer" is not added to links with a target.
    308308         *
    309309         * @ticket 46421
    310310         */
    class Test_WP_Widget_Custom_HTML extends WP_UnitTestCase {  
    326326                );
    327327
    328328                $output = get_echo( array( $widget, 'widget' ), array( $args, $instance ) );
    329                 $this->assertContains( 'rel="noopener noreferrer"', $output );
     329                $this->assertNotContains( 'rel="noopener noreferrer"', $output );
    330330        }
    331331
    332332        /**