Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

roll back and whitelist protocols

Repairing auto_link workflow
Closes #15 #16
  • Loading branch information...
commit 2c98ff66941aba4701f8ddedfcd7db5c82f57797 1 parent b9825e2
@homakov homakov authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/rails_autolink/helpers.rb
View
6 lib/rails_autolink/helpers.rb
@@ -60,18 +60,18 @@ def auto_link(text, *args, &block)#link = :all, html = {}, &block)
options.reverse_merge!(:link => :all, :html => {})
sanitize = (options[:sanitize] != false)
sanitize_options = options[:sanitize_options] || {}
- text = case options[:link].to_sym
+ text = conditional_sanitize(text, sanitize, sanitize_options).to_str
+ case options[:link].to_sym
when :all then conditional_html_safe(auto_link_email_addresses(auto_link_urls(text, options[:html], options, &block), options[:html], &block), sanitize)
when :email_addresses then conditional_html_safe(auto_link_email_addresses(text, options[:html], &block), sanitize)
when :urls then conditional_html_safe(auto_link_urls(text, options[:html], options, &block), sanitize)
end
- conditional_sanitize(text, sanitize, sanitize_options).to_str
end
private
AUTO_LINK_RE = %r{
- (?: ([0-9A-Za-z+.:-]+:)// | www\. )
+ (?: ((?:ed2k|ftp|http|https|irc|mailto|news|gopher|nntp|telnet|webcal|xmpp|callto|feed|svn|urn|aim|rsync|tag|ssh|sftp|rtsp|afs):)// | www\. )
[^\s<]+
}x
Please sign in to comment.
Something went wrong with that request. Please try again.