Make WordPress Core

Changeset 11844


Ignore:
Timestamp:
08/19/2009 11:56:10 PM (17 years ago)
Author:
azaozz
Message:

Removed trailing .) from the URL in make_clickable()

File:
1 edited

Legend:

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

    r11813 r11844  
    11861186function _make_url_clickable_cb($matches) {
    11871187    $url = $matches[2];
     1188
     1189    $after = '';
     1190    if ( preg_match( '|(.+)([).])$|', $url, $split ) ) {
     1191        $url = $split[1];
     1192        $after = $split[2];
     1193    }
     1194
    11881195    $url = esc_url($url);
    11891196    if ( empty($url) )
    11901197        return $matches[0];
    1191     return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>";
     1198
     1199    return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>$after";
    11921200}
    11931201
     
    12111219    if ( empty($dest) )
    12121220        return $matches[0];
    1213     // removed trailing [,;:] from URL
    1214     if ( in_array(substr($dest, -1), array('.', ',', ';', ':')) === true ) {
     1221
     1222    // removed trailing [.,;:)] from URL
     1223    if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
    12151224        $ret = substr($dest, -1);
    12161225        $dest = substr($dest, 0, strlen($dest)-1);
    12171226    }
    1218     return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>" . $ret;
     1227    return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
    12191228}
    12201229
Note: See TracChangeset for help on using the changeset viewer.