about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-02-07 15:24:22 +0100
committermultiple creatures <dev@multiple-creature.party>2020-02-20 23:08:01 -0600
commit14a5d249ad2ad78f00699bbab9062b3ea88ec93c (patch)
treebb30ad6ae119361c469539485d95fd83382e1fff /app/lib
parent03953a045149853d3bada69bbb8e91c4c5e53d62 (diff)
port tootsuite/#13042 to monsterfork: Fix malformed HTML causing uncaught error
Fix OEmbed preview API leaking existence of private statuses (see #12930)
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/formatter.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index b81ef8668..77b3ac97e 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -248,6 +248,7 @@ class Formatter
     html.html_safe # rubocop:disable Rails/OutputSafety
   end
 
+<<<<<<< HEAD
   def format_screenreader(html)
     html.gsub(/\ufdd3(.*)\ufdd4/m, '<span aria-hidden="true">\1</span>')
   end
@@ -278,6 +279,8 @@ class Formatter
     html.gsub!("\r\n", "\n")
     html.gsub!("\n\r", "\n")
     html.gsub("\r", "\n")
+  rescue ArgumentError
+    ''
   end
 
   def plaintext(status)