Make WordPress Core

Changeset 24554


Ignore:
Timestamp:
07/03/2013 10:36:13 PM (11 years ago)
Author:
ocean90
Message:

Lose content removal and splitting from get_content_url(). And remove unneeded lines from [24400].

fixes #24484.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r24550 r24554  
    24252425                            if ( ! $matched )
    24262426                                $matched = do_shortcode_tag( $shortcode );
    2427                             // $content = str_replace( $shortcode[0], '', $content, $count );
    24282427                        }
    24292428                    }
     
    24392438                            if ( ! $matched )
    24402439                                $matched = $match[0];
    2441                             // $content = str_replace( $match[0], '', $content, $count );
    24422440                        }
    24432441                    }
     
    25062504        return $attachment_id;
    25072505
    2508     $classes = $matches[2]; 
    2509     if ( ! empty( $classes ) && false !== strpos( $classes, 'wp-image-' ) ) 
    2510         if ( preg_match( '#wp-image-([0-9]+)#i', $classes, $matches ) ) 
     2506    $classes = $matches[2];
     2507    if ( ! empty( $classes ) && false !== strpos( $classes, 'wp-image-' ) )
     2508        if ( preg_match( '#wp-image-([0-9]+)#i', $classes, $matches ) )
    25112509            $attachment_id = absint( $matches[1] );
    25122510
  • trunk/wp-includes/post-formats.php

    r24399 r24554  
    241241 * @since 3.6.0
    242242 *
    243  * @param string $content A string which might contain a URL, passed by reference.
    244  * @param boolean $remove Whether to remove the found URL from the passed content.
     243 * @param string $content A string which might contain a URL.
    245244 * @return string The found URL.
    246245 */
    247 function get_content_url( &$content, $remove = false ) {
     246function get_content_url( $content ) {
    248247    if ( empty( $content ) )
    249248        return '';
     
    252251    $trimmed = trim( $content );
    253252    if ( 0 === stripos( $trimmed, 'http' ) && ! preg_match( '#\s#', $trimmed ) ) {
    254         if ( $remove )
    255             $content = '';
    256 
    257253        return $trimmed;
     254
    258255    // the content is HTML so we grab the first href
    259256    } elseif ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) ) {
     
    265262
    266263    // the content is a URL followed by content
    267     if ( 0 === stripos( $line, 'http' ) ) {
    268         if ( $remove )
    269             $content = trim( join( "\n", $lines ) );
    270 
     264    if ( 0 === stripos( $line, 'http' ) )
    271265        return esc_url_raw( $line );
    272     }
    273266
    274267    return '';
Note: See TracChangeset for help on using the changeset viewer.