Don't force newlines around URLs in WP_Embed::autoembed().
props chipx86, sgrant. fixes #23776. Built from https://develop.svn.wordpress.org/trunk@31066 git-svn-id: http://core.svn.wordpress.org/trunk@31047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6299d3f617
commit
7df3885d2e
|
@ -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];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue