[wp-trac] [WordPress Trac] #23050: make_clickable incorrectly formats anchors with URL's and spaces in them in comments

WordPress Trac noreply at wordpress.org
Fri Nov 1 02:57:48 UTC 2013


#23050: make_clickable incorrectly formats anchors with URL's and spaces in them in
comments
-----------------------------+------------------------------
 Reporter:  johnjamesjacoby  |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Formatting       |     Version:  3.4.2
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |
-----------------------------+------------------------------
Changes (by netweb):

 * keywords:  has-patch => needs-patch


Comment:

 Spoke to soon, adding some unit tests (I am pretty sure links should
 include `rel="nofollow"`)

 * 23050-unit-tests.diff - Resulting links WITHOUT `rel="nofollow"`
 * 23050-unit-tests-nofollow.diff - Resulting links WITH `rel="nofollow"`

 Current patch attachment:fix.make.clickable.23050.diff​ breaks PHPUnit
 formatting test.

 {{{#!bash
 $ phpunit --group formatting
 There was 1 failure:
 1) Tests_Formatting_MakeClickable::test_no_links_within_links
 Failed asserting that two strings are equal.
 --- Expected
 +++ Actual
 @@ @@
 -'Some text with a link <a
 href="http://example.com">http://example.com</a>'
 +'Some text with a link <a href="http://example.com"><a
 href="http://example.com" rel="nofollow">http://example.com</a></a>'
 }}}

 {{{#!bash
 $ phpunit --group 23050
 There was 1 failure:

 1) Tests_Formatting_MakeClickable::test_anchors_with_url_and_words
 Failed asserting that two strings are equal.
 --- Expected
 +++ Actual
 @@ @@
 -'Hey! <a href="http://wordpress.org" rel="nofollow">http://wordpress.org
 is awesome</a> if you have clicks to give!'
 +'Hey! <a href="http://wordpress.org">http://wordpress.org is awesome</a>
 if you have clicks to give!'
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/23050#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list