[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 18:30:35 UTC 2024


#62037: make_clickable doesn't handle closing parenthesis character just before the
'dot' on a file URL.
-------------------------------+------------------------------
 Reporter:  rhellewell@…       |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Formatting         |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Description changed by hellofromTonya:

Old description:

> The
> {{{
> make_clickable
> }}}
>  function will convert a text URL into a clickable HREF. This works well,
> even with text URLs that contain a space.
>
> But consider this URL when typed into a post or comment box:
>

> {{{
>  https://www.example.com/some-page(2).jpg
> }}}
>

> That URL will 'break' (when converted to an HREF by make_clickable)
> because of the closing parenthesis character just before the 'dot',
> turning the clickable part of the URL into
>

> {{{
> https://www.example.com/some-page(2
> }}}
>

> with the '.jpg' shown as text (outside of the HREF 'target')
>
> This was tested with  with WP 6.6.1 on PHP 8.1.28 and verified by another
> StackOverFlow user (see
> https://wordpress.stackexchange.com/q/426740/29416 )

New description:

 The `make_clickable()` function will convert a text URL into a clickable
 HREF. This works well, even with text URLs that contain a space.

 But consider this URL when typed into a post or comment box:


 {{{
  https://www.example.com/some-page(2).jpg
 }}}


 That URL will 'break' (when converted to an HREF by make_clickable)
 because of the closing parenthesis character just before the 'dot',
 turning the clickable part of the URL into


 {{{
 https://www.example.com/some-page(2
 }}}


 with the '.jpg' shown as text (outside of the HREF 'target')

 This was tested with  with WP 6.6.1 on PHP 8.1.28 and verified by another
 StackOverFlow user (see https://wordpress.stackexchange.com/q/426740/29416
 )

--

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


More information about the wp-trac mailing list