[wp-trac] [WordPress Trac] #26868: Function 'make_clickable()' doesn't make hyperlinks from explicit URLs using the `mailto:`, `tel:` and other schemes that do not start with `//`

WordPress Trac noreply at wordpress.org
Sat Jan 18 16:00:15 UTC 2014


#26868: Function 'make_clickable()' doesn't make hyperlinks from explicit URLs
using the `mailto:`, `tel:` and other schemes that do not start with `//`
--------------------------+-----------------------------
 Reporter:  mdgl          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:  3.8
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Function `make_clickable()` tries to recognise URLs and convert these into
 clickable hyperlinks. The function is by default configured as a filter
 for comment text.

 Unfortunately, the function assumes that all explicitly declared URLs
 begin with the string `//` after the scheme and colon parts which is not
 the case for the `mailto:`, `tel:` and many other schemes.  Such URLs
 could usefully be made clickable, especially for use on smartphones and
 tablets.

 This also leads to inconsistencies between explicitly and implicitly
 declared URLs.  For example, the string `myemail at mydomain.com` is
 converted into a clickable hyperlink whilst the string
 `mailto:myemail at mydomain.com` is not.

 By contrast, the TinyMCE post editor correctly and automatically makes
 both implicit and explicit `mailto:` links clickable but does nothing with
 `tel:`.

 For reference, the syntax of URLs is defined by
 http://tools.ietf.org/html/std66, the `mailto:` scheme by
 http://tools.ietf.org/html/rfc6068 and that for `tel:` by
 http://tools.ietf.org/html/rfc3966.

 As #16892 has illustrated, parsing URLs can be hard. The use of
 `wp_allowed_protocols()` may help in detecting which strings we wish to
 make clickable.

 Found whilst testing #22946.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26868>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list