WordPress.org

Make WordPress Core

Changeset 14249


Ignore:
Timestamp:
04/27/2010 05:21:39 AM (8 years ago)
Author:
nacin
Message:

Simply search for newlines to strip instead of checking the oEmbed provider. fixes #12115.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-oembed.php

    r14109 r14249  
    5757        ) );
    5858
    59         // Fix Scribd and Viddler embeds. They contain new lines in the middle of the HTML which breaks wpautop().
     59        // Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop().
    6060        add_filter( 'oembed_dataparse', array(&$this, '_strip_newlines'), 10, 3 );
    6161    }
     
    264264
    265265    /**
    266      * Strip new lines from the HTML if it's a Scribd or Viddler embed.
     266     * Strip any new lines from the HTML.
    267267     *
    268268     * @access private
     
    273273     */
    274274    function _strip_newlines( $html, $data, $url ) {
    275         if ( preg_match( '#http://(www\.)?scribd.com/.*#i', $url ) || preg_match( '#http://(www\.)?viddler\.com/.*#i', $url ) )
     275        if ( false !== strpos( "\n", $html ) )
    276276            $html = str_replace( array( "\r\n", "\n" ), '', $html );
    277277
Note: See TracChangeset for help on using the changeset viewer.