Ticket #12115: 12115.patch
| File 12115.patch, 1.2 KB (added by , 16 years ago) |
|---|
-
wp-includes/class-oembed.php
52 52 'http://wordpress.tv/*' => array( 'http://wordpress.tv/oembed/', false ), 53 53 ) ); 54 54 55 // Fix Scribd embeds. They contain new lines in the middle of the HTML which breaks wpautop().56 add_filter( 'oembed_dataparse', array(&$this, 'strip_ scribd_newlines'), 10, 3 );55 // Fix Scribd and Viddler embeds. They contain new lines in the middle of the HTML which breaks wpautop(). 56 add_filter( 'oembed_dataparse', array(&$this, 'strip_newlines'), 10, 3 ); 57 57 } 58 58 59 59 /** … … 239 239 * @param string $url The original URL passed to oEmbed. 240 240 * @return string Possibly modified $html 241 241 */ 242 function strip_ scribd_newlines( $html, $data, $url ) {243 if ( preg_match( '#http://(www\.)?scribd.com/.*#i', $url ) )242 function strip_newlines( $html, $data, $url ) { 243 if ( preg_match( '#http://(www\.)?scribd.com/.*#i', $url ) || preg_match( '#http://(www\.)?viddler\.com/.*#i', $url ) ) 244 244 $html = str_replace( array( "\r\n", "\n" ), '', $html ); 245 245 246 246 return $html;