diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 27d64e1dc6..ed87b2b8ad 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -1742,7 +1742,7 @@ function make_clickable( $text ) { } // Cleanup of accidental links within links - $r = preg_replace( '#(]+?>|>))]+?>([^>]+?)#i', "$1$3", $r ); + $r = preg_replace( '#(]+?>|>))]+?>([^>]+?)#i', "$1$3", $r ); return $r; } diff --git a/tests/phpunit/tests/formatting/MakeClickable.php b/tests/phpunit/tests/formatting/MakeClickable.php index f6ae895be5..ef55b5c0f1 100644 --- a/tests/phpunit/tests/formatting/MakeClickable.php +++ b/tests/phpunit/tests/formatting/MakeClickable.php @@ -380,4 +380,13 @@ class Tests_Formatting_MakeClickable extends WP_UnitTestCase { $this->assertEquals( $urls_expected[$key], make_clickable( $url ) ); } } + + /** + * @ticket 19028 + */ + function test_line_break_in_existing_clickable_link() { + $html = "someone@example.com"; + $this->assertEquals( $html, make_clickable( $html ) ); + } }