mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Removed trailing .) from the URL in make_clickable()
git-svn-id: http://svn.automattic.com/wordpress/trunk@11844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6a6257ee42
commit
668cfea9f2
@ -1185,10 +1185,18 @@ function antispambot($emailaddy, $mailto=0) {
|
||||
*/
|
||||
function _make_url_clickable_cb($matches) {
|
||||
$url = $matches[2];
|
||||
|
||||
$after = '';
|
||||
if ( preg_match( '|(.+)([).])$|', $url, $split ) ) {
|
||||
$url = $split[1];
|
||||
$after = $split[2];
|
||||
}
|
||||
|
||||
$url = esc_url($url);
|
||||
if ( empty($url) )
|
||||
return $matches[0];
|
||||
return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>";
|
||||
|
||||
return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>$after";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1210,12 +1218,13 @@ function _make_web_ftp_clickable_cb($matches) {
|
||||
$dest = esc_url($dest);
|
||||
if ( empty($dest) )
|
||||
return $matches[0];
|
||||
// removed trailing [,;:] from URL
|
||||
if ( in_array(substr($dest, -1), array('.', ',', ';', ':')) === true ) {
|
||||
|
||||
// removed trailing [.,;:)] from URL
|
||||
if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
|
||||
$ret = substr($dest, -1);
|
||||
$dest = substr($dest, 0, strlen($dest)-1);
|
||||
}
|
||||
return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>" . $ret;
|
||||
return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user