[PATCH] Autolinking non-http protocols doesn't work

1 view
Skip to first unread message

Zach Brock

unread,
Nov 20, 2009, 2:18:40 PM11/20/09
to rubyonra...@googlegroups.com

If you redefined the AUTO_LINK_RE to support protocols other than HTTP, bad links are generated. In the auto_link_urls code it checks if there is an http in the generated href and if there isn't it prepends one. If you're using auto_link_urls on, for example, ftp:// links, instead of <a href="ftp://example.com">ftp://example.com</a> , you get <a href="http:// ftp://example.com">ftp://example.com</a>. This patch adds a test and changes the code to check for any protocol instead of just http before prepending the default.

This patch is against the 2-3-stable branch.

Lighthouse ticket: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3494-patch-autolinking-non-http-protocols-doesnt-work

-Zach Brock
Reply all
Reply to author
Forward
0 new messages