make_clickable: When cleaning up accidental links within links, account for the tag being split by newlines.

props dd32.
fixes #19028.

Built from https://develop.svn.wordpress.org/trunk@26974


git-svn-id: http://core.svn.wordpress.org/trunk@26853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-01-17 09:32:10 +00:00
parent 8ec592f244
commit 0ee1cb3046

View File

@ -1742,7 +1742,7 @@ function make_clickable( $text ) {
}
// Cleanup of accidental links within links
$r = preg_replace( '#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
$r = preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
return $r;
}