WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/07/2015 07:50:58 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Don't force newlines around URLs in WP_Embed::autoembed().

props chipx86, sgrant.
fixes #23776.

File:
1 edited

Legend:

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

    r31034 r31066  
    312312     */
    313313    public function autoembed( $content ) {
    314         return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
     314        return preg_replace_callback( '|^(\s*)(https?://[^\s"]+)(\s*)$|im', array( $this, 'autoembed_callback' ), $content );
    315315    }
    316316
     
    324324        $oldval = $this->linkifunknown;
    325325        $this->linkifunknown = false;
    326         $return = $this->shortcode( array(), $match[1] );
     326        $return = $this->shortcode( array(), $match[2] );
    327327        $this->linkifunknown = $oldval;
    328328
    329         return "\n$return\n";
     329        return $match[1] . $return . $match[3];
    330330    }
    331331
Note: See TracChangeset for help on using the changeset viewer.