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 {
|
| 143 | 143 | /** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */ |
| 144 | 144 | $content = apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this ); |
| 145 | 145 | |
| 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 | | |
| 149 | 146 | /** |
| 150 | 147 | * Filters the content of the Custom HTML widget. |
| 151 | 148 | * |
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 {
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | /** |
| 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. |
| 308 | 308 | * |
| 309 | 309 | * @ticket 46421 |
| 310 | 310 | */ |
| … |
… |
class Test_WP_Widget_Custom_HTML extends WP_UnitTestCase {
|
| 326 | 326 | ); |
| 327 | 327 | |
| 328 | 328 | $output = get_echo( array( $widget, 'widget' ), array( $args, $instance ) ); |
| 329 | | $this->assertContains( 'rel="noopener noreferrer"', $output ); |
| | 329 | $this->assertNotContains( 'rel="noopener noreferrer"', $output ); |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | /** |