WordPress.org

Make WordPress Core

Ticket #17764: 17764.diff

File 17764.diff, 889 bytes (added by sushkov, 16 months ago)
  • wp-includes/media.php

    diff --git wp-includes/media.php wp-includes/media.php
    index e3b9008..808dcaf 100644
    class WP_Embed { 
    12611261         * @return string Potentially modified $content. 
    12621262         */ 
    12631263        function autoembed( $content ) { 
    1264                 return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array(&$this, 'autoembed_callback'), $content ); 
     1264                return preg_replace_callback( 
     1265                        '|^\s*(?:<a href="[^"]+">)?(?P<url>https?://[^\s<"]+)(?:</a>)?\s*$|im', 
     1266                        array( &$this, 'autoembed_callback' ), 
     1267                        $content 
     1268                ); 
    12651269        } 
    12661270 
    12671271        /** 
    class WP_Embed { 
    12751279        function autoembed_callback( $match ) { 
    12761280                $oldval = $this->linkifunknown; 
    12771281                $this->linkifunknown = false; 
    1278                 $return = $this->shortcode( array(), $match[1] ); 
     1282                $return = $this->shortcode( array(), $match['url'] ); 
    12791283                $this->linkifunknown = $oldval; 
    12801284 
    12811285                return "\n$return\n";