From: TheKinrar Date: Wed, 2 Aug 2017 12:54:33 +0000 (+0200) Subject: Don't normalize invalid domain names (#4499) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=9ba7d526a0712afa073c6901bf2e69bae0dfab26;p=mastodon.git Don't normalize invalid domain names (#4499) Fixes #4496 --- diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index 7b89305ac..cacc0364f 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -104,7 +104,7 @@ class Formatter html_attrs = { target: '_blank', rel: 'nofollow noopener' } Twitter::Autolink.send(:link_to_text, entity, link_html(entity[:url]), normalized_url, html_attrs) - rescue Addressable::URI::InvalidURIError + rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError encode(entity[:url]) end