Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#3494

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.

Reported by Zach Brock · November 19th, 2009 @ 07:00 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Zach Brock
    Zach Brock
    • Tag changed from actionview, auto_link, patch, rails, text_helper to 2.3.x, actionview, auto_link, patch, rails, text_helper

    November 19th, 2009 @ 07:05 AM

  2. Zach Brock
    Zach Brock

    Here's a new patch against 2-3-stable that scopes the regex to the beginning of the url

    November 25th, 2009 @ 08:39 AM

  3. Zach Brock
  4. Josh Susser
    Josh Susser

    +1 works for me. Can we get this on 2-3-stable soon?

    November 30th, 2009 @ 06:07 AM

  5. Repository
    Repository
    • State changed from new to committed

    (from [f32c96eb760abca984b86435f89b7bbc149e78c7]) fixing autolinking other protocols

    Signed-off-by: Michael Koziarski michael@koziarski.com
    [#3494 state:committed] http://github.com/rails/rails/commit/f32c96eb760abca984b86435f89b7b...

    January 4th, 2010 @ 09:57 PM

  6. Repository
    Repository
    • State changed from committed to resolved

    (from [bd9ca9aed0b5ab3697a7ae27a53664f3118b132c]) auto_link: support arbitrary URI schemes like "ftp:" and "file:"

    recognizes all URI scheme allowed characters, such as colon and period.

    [#3494 state:resolved] http://github.com/rails/rails/commit/bd9ca9aed0b5ab3697a7ae27a53664...

    May 29th, 2010 @ 03:06 AM

  7. Repository
    Repository

    (from [133ada6ab0f0cb7bef2bd40dbc18f2d5bc6b964e]) auto_link: support arbitrary URI schemes like "ftp:" and "file:"

    recognizes all URI scheme allowed characters, such as colon and period.

    [#3494 state:resolved] http://github.com/rails/rails/commit/133ada6ab0f0cb7bef2bd40dbc18f2...

    May 29th, 2010 @ 03:06 AM