[wp-trac] [WordPress Trac] #45702: make_clickable() doesn't handle linked text being a URL with spaces within it

WordPress Trac noreply at wordpress.org
Wed Apr 3 16:39:31 UTC 2019


#45702: make_clickable() doesn't handle linked text being a URL with spaces within
it
------------------------------------------+-----------------------------
 Reporter:  dd32                          |       Owner:  (none)
     Type:  defect (bug)                  |      Status:  new
 Priority:  low                           |   Milestone:  Future Release
Component:  Formatting                    |     Version:
 Severity:  trivial                       |  Resolution:
 Keywords:  needs-unit-tests needs-patch  |     Focuses:
------------------------------------------+-----------------------------
Changes (by danielbachhuber):

 * milestone:  Awaiting Review => Future Release


Comment:

 Here's another variation on the problem I've run across:

 {{{
 wp> make_clickable( '<p><a href="https://search.google.com/structured-data
 /testing-tool#url=">https://search.google.com/s...</a>' );
 => string(249) "<p><a href="https://search.google.com/structured-data
 /testing-tool#url="><a href="https://search.google.com/s"
 rel="nofollow">https://search.google.com/s</a>...</a>"
 }}}

 Replacing `...` with `…` fixes it:

 {{{
 wp> make_clickable( '<p><a href="https://search.google.com/structured-data
 /testing-tool#url=">https://search.google.com/s…</a>' );
 => string(192) "<p><a href="https://search.google.com/structured-data
 /testing-tool#url=">https://search.google.com/s…</a>"
 }}}

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


More information about the wp-trac mailing list