WordPress.org

Make WordPress Core

Ticket #4968: 4968.2.diff

File 4968.2.diff, 1.6 KB (added by regulatethis, 10 years ago)

FWIW, this patch removes the function make_url_footnote and the 1 call to it. Seems straightforward, but could use some more testing.

  • wp-includes/functions.php

     
    410410        return $data;
    411411}
    412412
    413 
    414 function make_url_footnote( $content ) {
    415         preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
    416         $j = 0;
    417         for ( $i=0; $i<count($matches[0]); $i++ ) {
    418                 $links_summary = ( !$j ) ? "\n" : $links_summary;
    419                 $j++;
    420                 $link_match = $matches[0][$i];
    421                 $link_number = '['.($i+1).']';
    422                 $link_url = $matches[2][$i];
    423                 $link_text = $matches[4][$i];
    424                 $content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );
    425                 $link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
    426                 $links_summary .= "\n" . $link_number . ' ' . $link_url;
    427         }
    428         $content  = strip_tags( $content );
    429         $content .= $links_summary;
    430         return $content;
    431 }
    432 
    433 
    434413function xmlrpc_getposttitle( $content ) {
    435414        global $post_default_title;
    436415        if ( preg_match( '/<title>(.+?)<\/title>/is', $content, $matchtitle ) ) {
  • wp-includes/feed.php

     
    4545        if ( 1== $encode_html ) {
    4646                $content = wp_specialchars($content);
    4747                $cut = 0;
    48         } elseif ( 0 == $encode_html ) {
    49                 $content = make_url_footnote($content);
    5048        } elseif ( 2 == $encode_html ) {
    5149                $content = strip_tags($content);
    5250        }