]> cat aescling's git repositories - mastodon.git/commitdiff
Don't normalize invalid domain names (#4499)
authorTheKinrar <contact@thekinrar.fr>
Wed, 2 Aug 2017 12:54:33 +0000 (14:54 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 2 Aug 2017 12:54:33 +0000 (14:54 +0200)
Fixes #4496

app/lib/formatter.rb

index 7b89305ac535a721e5e3ef584f5a1f62ccdc8e2f..cacc0364fd84b356b60af707c6e22486385d3579 100644 (file)
@@ -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