FIX: remove deprecated URI.escape (#9697)

During Nokogumbo changes I introduced back URI.escape which is deprecated.
This commit is contained in:
Krzysztof Kotlarek
2020-05-08 11:14:59 +10:00
committed by GitHub
parent 22dffe6f69
commit a3e1e9ef16
2 changed files with 5 additions and 5 deletions

View File

@@ -286,7 +286,7 @@ module PrettyText
doc.css("a").each do |l|
href = l["href"].to_s
begin
uri = URI(URI.escape(href))
uri = URI(UrlHelper.encode_component(href))
site_uri ||= URI(Discourse.base_url)
if !uri.host.present? ||
@@ -466,13 +466,13 @@ module PrettyText
case type
when USER_TYPE
element['href'] = "#{Discourse::base_uri}/u/#{URI.escape(name)}"
element['href'] = "#{Discourse::base_uri}/u/#{UrlHelper.encode_component(name)}"
when GROUP_MENTIONABLE_TYPE
element['class'] = 'mention-group notify'
element['href'] = "#{Discourse::base_uri}/groups/#{URI.escape(name)}"
element['href'] = "#{Discourse::base_uri}/groups/#{UrlHelper.encode_component(name)}"
when GROUP_TYPE
element['class'] = 'mention-group'
element['href'] = "#{Discourse::base_uri}/groups/#{URI.escape(name)}"
element['href'] = "#{Discourse::base_uri}/groups/#{UrlHelper.encode_component(name)}"
end
end
end