FIX: rescue InvalidURIError when removing user ids from links

This commit is contained in:
Arpit Jalan
2019-04-25 12:36:31 +05:30
parent 84cfe30c1f
commit 6f5d7f987e
2 changed files with 8 additions and 1 deletions

View File

@@ -598,7 +598,11 @@ class CookedPostProcessor
def remove_user_ids
@doc.css("a[href]").each do |a|
uri = URI(a["href"])
uri = begin
URI(a["href"])
rescue URI::Error
next
end
next if uri.hostname != Discourse.current_hostname
query = Rack::Utils.parse_nested_query(uri.query)