From 5a02f2cd5088463c5808a1e2fb2ca69932b67ef2 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 24 Oct 2017 21:31:16 +0000 Subject: [PATCH] Widgets: Limit container-constraining logic in Text widget to `video`, `iframe`, `object`, and `embed` elements. Amends [41779]. See #40854. git-svn-id: https://develop.svn.wordpress.org/trunk@42001 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/widgets/class-wp-widget-text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/widgets/class-wp-widget-text.php b/src/wp-includes/widgets/class-wp-widget-text.php index d4fe281f2d..ffcfe0cd09 100644 --- a/src/wp-includes/widgets/class-wp-widget-text.php +++ b/src/wp-includes/widgets/class-wp-widget-text.php @@ -292,7 +292,7 @@ class WP_Widget_Text extends WP_Widget { echo $args['before_title'] . $title . $args['after_title']; } - $text = preg_replace_callback( '#<[^>]*>#', array( $this, 'inject_video_max_width_style' ), $text ); + $text = preg_replace_callback( '#<(video|iframe|object|embed)\s[^>]*>#i', array( $this, 'inject_video_max_width_style' ), $text ); ?>