about summary refs log tree commit diff
path: root/app/lib/formatter.rb
diff options
context:
space:
mode:
authorabcang <abcang1015@gmail.com>2017-05-10 01:17:41 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-09 18:17:41 +0200
commit08e94d1b197a053504ce37dbbe03216a80043b10 (patch)
treea4dc7f3d2cb63c318383654e3d26dbf431f43731 /app/lib/formatter.rb
parent2fba94b36eac65a368ec10f4c8c5808baa0179e7 (diff)
Fixed bug that timeline can not be displayed by InvalidURIError (#2947)
Diffstat (limited to 'app/lib/formatter.rb')
-rw-r--r--app/lib/formatter.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 12b030e11..0f2989a81 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -92,6 +92,8 @@ class Formatter
       rel: 'nofollow noopener',
     }
     Twitter::Autolink.send(:link_to_text, entity, link_html(entity[:url]), normalized_url, html_attrs)
+  rescue Addressable::URI::InvalidURIError
+    encode(entity[:url])
   end
 
   def link_to_mention(entity, mentions)