From f9115ee6689aff263b3e352af1e725bb85f3e8dd Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 27 Apr 2010 05:21:39 +0000 Subject: [PATCH] Simply search for newlines to strip instead of checking the oEmbed provider. fixes #12115. git-svn-id: http://svn.automattic.com/wordpress/trunk@14249 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-oembed.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-oembed.php b/wp-includes/class-oembed.php index beecf4ee39..a9d7ae43c9 100644 --- a/wp-includes/class-oembed.php +++ b/wp-includes/class-oembed.php @@ -56,7 +56,7 @@ class WP_oEmbed { '#http://(www\.)?funnyordie\.com/videos/.*#i' => array( 'http://www.funnyordie.com/oembed', true ), ) ); - // Fix Scribd and Viddler embeds. They contain new lines in the middle of the HTML which breaks wpautop(). + // Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop(). add_filter( 'oembed_dataparse', array(&$this, '_strip_newlines'), 10, 3 ); } @@ -263,7 +263,7 @@ class WP_oEmbed { } /** - * Strip new lines from the HTML if it's a Scribd or Viddler embed. + * Strip any new lines from the HTML. * * @access private * @param string $html Existing HTML. @@ -272,7 +272,7 @@ class WP_oEmbed { * @return string Possibly modified $html */ function _strip_newlines( $html, $data, $url ) { - if ( preg_match( '#http://(www\.)?scribd.com/.*#i', $url ) || preg_match( '#http://(www\.)?viddler\.com/.*#i', $url ) ) + if ( false !== strpos( "\n", $html ) ) $html = str_replace( array( "\r\n", "\n" ), '', $html ); return $html;