mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix #2221 - Catch OpenSSL exceptions when loading remote avatars/headers/attachments Don't strip "rel" attribute from <a> tags when sanitizing (microformats)
This commit is contained in:
parent
60ecfb87ae
commit
58bcd50f7f
@ -302,6 +302,8 @@
|
|||||||
display: block;
|
display: block;
|
||||||
color: $ui-base-color;
|
color: $ui-base-color;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.display_name {
|
.display_name {
|
||||||
|
@ -8,7 +8,7 @@ class Sanitize
|
|||||||
elements: %w(p br span a),
|
elements: %w(p br span a),
|
||||||
|
|
||||||
attributes: {
|
attributes: {
|
||||||
'a' => %w(href),
|
'a' => %w(href rel),
|
||||||
'span' => %w(class),
|
'span' => %w(class),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ module AccountAvatar
|
|||||||
|
|
||||||
self.avatar = URI.parse(parsed_url.to_s)
|
self.avatar = URI.parse(parsed_url.to_s)
|
||||||
self[:avatar_remote_url] = url
|
self[:avatar_remote_url] = url
|
||||||
rescue OpenURI::HTTPError => e
|
rescue OpenURI::HTTPError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError => e
|
||||||
Rails.logger.debug "Error fetching remote avatar: #{e}"
|
Rails.logger.debug "Error fetching remote avatar: #{e}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -34,7 +34,7 @@ module AccountHeader
|
|||||||
|
|
||||||
self.header = URI.parse(parsed_url.to_s)
|
self.header = URI.parse(parsed_url.to_s)
|
||||||
self[:header_remote_url] = url
|
self[:header_remote_url] = url
|
||||||
rescue OpenURI::HTTPError => e
|
rescue OpenURI::HTTPError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError => e
|
||||||
Rails.logger.debug "Error fetching remote header: #{e}"
|
Rails.logger.debug "Error fetching remote header: #{e}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -223,7 +223,7 @@ class ProcessFeedService < BaseService
|
|||||||
begin
|
begin
|
||||||
media.file_remote_url = link['href']
|
media.file_remote_url = link['href']
|
||||||
media.save
|
media.save
|
||||||
rescue OpenURI::HTTPError, Paperclip::Errors::NotIdentifiedByImageMagickError
|
rescue OpenURI::HTTPError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user