mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 20:44:40 +08:00
FIX: URLs containing two # would fail to work
Some URLs in browsers are non compliant and contain twos `#` this commit adds special handling for this edge case by auto encoding any fragments containing `#`
This commit is contained in:
@ -15,11 +15,7 @@ class TopicLinkClick < ActiveRecord::Base
|
||||
url = args[:url][0...TopicLink.max_url_length]
|
||||
return nil if url.blank?
|
||||
|
||||
uri = begin
|
||||
URI.parse(url)
|
||||
rescue URI::Error
|
||||
end
|
||||
|
||||
uri = UrlHelper.relaxed_parse(url)
|
||||
urls = Set.new
|
||||
urls << url
|
||||
if url =~ /^http/
|
||||
|
Reference in New Issue
Block a user