[wp-trac] [WordPress Trac] #62037: make_clickable doesn't handle closing parenthesis character just before the 'dot' on a file URL.

WordPress Trac noreply at wordpress.org
Thu Sep 12 19:13:24 UTC 2024


#62037: make_clickable doesn't handle closing parenthesis character just before the
'dot' on a file URL.
--------------------------------------+-----------------------------
 Reporter:  rhellewell@…              |       Owner:  hellofromTonya
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  6.7
Component:  Formatting                |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------
Changes (by hellofromTonya):

 * owner:  (none) => hellofromTonya
 * status:  new => assigned
 * milestone:  Awaiting Review => 6.7


Comment:

 [https://github.com/WordPress/wordpress-develop/pull/7343 PR 7343] adds
 tests to valid URL that has `()` within its path and has an extension. As
 reported in this ticket, the following dataset

 {{{
 'URL with brackets in path before the extension' => array(
         'text'     => 'http://example-image(2).jpg',
         'expected' => '<a href="http://example-image(2).jpg"
 rel="nofollow">http://example-image(2).jpg</a>',
 ),
 }}}

 fails with this report:
 {{{
 1) Tests_Formatting_MakeClickable::test_urls with data set "URL with
 brackets in path before the extension" ('http://example-image(2).jpg', '<a
 href="http://example-image...pg</a>')
 Failed asserting that two strings are identical.
 --- Expected
 +++ Actual
 @@ @@
 -'<a href="http://example-image(2).jpg" rel="nofollow">http://example-
 image(2).jpg</a>'
 +'<a href="http://example-image(2)" rel="nofollow">http://example-
 image(2)</a>.jpg'
 }}}

 whereas this dataset

 {{{
 'URL with brackets within path and with a extension' => array(
         'text'     => 'http://example-(2)-image.jpg',
         'expected' => '<a href="http://example-(2)-image.jpg"
 rel="nofollow">http://example-(2)-image.jpg</a>',
 ),
 }}}

 passes.

 This is a reproducible bug. Moving it into the 6.7 milestone.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62037#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list