]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-embed.php
WordPress 4.2.3
[autoinstalls/wordpress.git] / wp-includes / class-wp-embed.php
index 9569f38df3b78aa08e2a2426cb492fc667bf9f50..eda4467c45633659c4f630dae0dff4ada96bd34b 100644 (file)
@@ -57,7 +57,7 @@ class WP_Embed {
                add_shortcode( 'embed', array( $this, 'shortcode' ) );
 
                // Do the shortcode (only the [embed] one is registered)
                add_shortcode( 'embed', array( $this, 'shortcode' ) );
 
                // Do the shortcode (only the [embed] one is registered)
-               $content = do_shortcode( $content );
+               $content = do_shortcode( $content, true );
 
                // Put the original shortcodes back
                $shortcode_tags = $orig_shortcode_tags;
 
                // Put the original shortcodes back
                $shortcode_tags = $orig_shortcode_tags;
@@ -312,6 +312,10 @@ class WP_Embed {
         * @return string Potentially modified $content.
         */
        public function autoembed( $content ) {
         * @return string Potentially modified $content.
         */
        public function autoembed( $content ) {
+               // Strip newlines from all elements.
+               $content = wp_replace_in_html_tags( $content, array( "\n" => " " ) );
+
+               // Find URLs that are on their own line.
                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 );
        }