Make WordPress Core


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

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

fixes #24484.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.