diff --git a/wp-includes/class-wp-embed.php b/wp-includes/class-wp-embed.php index f536f71a04..1cd4d6252c 100644 --- a/wp-includes/class-wp-embed.php +++ b/wp-includes/class-wp-embed.php @@ -311,7 +311,7 @@ class WP_Embed { * @return string Potentially modified $content. */ public function autoembed( $content ) { - return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content ); + return preg_replace_callback( '|^(\s*)(https?://[^\s"]+)(\s*)$|im', array( $this, 'autoembed_callback' ), $content ); } /** @@ -323,10 +323,10 @@ class WP_Embed { public function autoembed_callback( $match ) { $oldval = $this->linkifunknown; $this->linkifunknown = false; - $return = $this->shortcode( array(), $match[1] ); + $return = $this->shortcode( array(), $match[2] ); $this->linkifunknown = $oldval; - return "\n$return\n"; + return $match[1] . $return . $match[3]; } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 5ddb6e9384..2d30ec6c14 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31065'; +$wp_version = '4.2-alpha-31066'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.