diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/lib/atom_serializer.rb | 6 | ||||
-rw-r--r-- | app/views/api/v1/statuses/_media.rabl | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/app/lib/atom_serializer.rb b/app/lib/atom_serializer.rb index 4e4031bba..5aeb7b4f9 100644 --- a/app/lib/atom_serializer.rb +++ b/app/lib/atom_serializer.rb @@ -3,13 +3,11 @@ class AtomSerializer include RoutingHelper - INVALID_XML_CHARS = /[^\u0009\u000a\u000d\u0020-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]/ - class << self def render(element) document = Ox::Document.new(version: '1.0') document << element - ('<?xml version="1.0"?>' + Ox.dump(element)).force_encoding('UTF-8') + ('<?xml version="1.0"?>' + Ox.dump(element, effort: :tolerant)).force_encoding('UTF-8') end end @@ -319,7 +317,7 @@ class AtomSerializer end def sanitize_str(raw_str) - raw_str.to_s.gsub(INVALID_XML_CHARS, '') + raw_str.to_s end def add_namespaces(parent) diff --git a/app/views/api/v1/statuses/_media.rabl b/app/views/api/v1/statuses/_media.rabl index 80d80ea05..2f56c6d07 100644 --- a/app/views/api/v1/statuses/_media.rabl +++ b/app/views/api/v1/statuses/_media.rabl @@ -1,5 +1,5 @@ attributes :id, :remote_url, :type -node(:url) { |media| media.file.blank? ? media.remote_url : full_asset_url(media.file.url(:original)) } -node(:preview_url) { |media| media.file.blank? ? media.remote_url : full_asset_url(media.file.url(:small)) } +node(:url) { |media| full_asset_url(media.file.url(:original)) } +node(:preview_url) { |media| full_asset_url(media.file.url(:small)) } node(:text_url) { |media| media.local? ? medium_url(media) : nil } |