Browse Source

Fix #1426 - Trim long usernames in public follower/following lists (#2993)

Fix #2221 - Catch OpenSSL exceptions when loading remote avatars/headers/attachments
Don't strip "rel" attribute from <a> tags when sanitizing (microformats)
master
Eugen Rochko 7 years ago
committed by GitHub
parent
commit
58bcd50f7f
5 changed files with 6 additions and 4 deletions
  1. +2
    -0
      app/javascript/styles/accounts.scss
  2. +1
    -1
      app/lib/sanitize_config.rb
  3. +1
    -1
      app/models/concerns/account_avatar.rb
  4. +1
    -1
      app/models/concerns/account_header.rb
  5. +1
    -1
      app/services/process_feed_service.rb

+ 2
- 0
app/javascript/styles/accounts.scss View File

@ -302,6 +302,8 @@
display: block;
color: $ui-base-color;
text-decoration: none;
text-overflow: ellipsis;
overflow: hidden;
&:hover {
.display_name {

+ 1
- 1
app/lib/sanitize_config.rb View File

@ -8,7 +8,7 @@ class Sanitize
elements: %w(p br span a),
attributes: {
'a' => %w(href),
'a' => %w(href rel),
'span' => %w(class),
},

+ 1
- 1
app/models/concerns/account_avatar.rb View File

@ -34,7 +34,7 @@ module AccountAvatar
self.avatar = URI.parse(parsed_url.to_s)
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}"
end
end

+ 1
- 1
app/models/concerns/account_header.rb View File

@ -34,7 +34,7 @@ module AccountHeader
self.header = URI.parse(parsed_url.to_s)
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}"
end
end

+ 1
- 1
app/services/process_feed_service.rb View File

@ -223,7 +223,7 @@ class ProcessFeedService < BaseService
begin
media.file_remote_url = link['href']
media.save
rescue OpenURI::HTTPError, Paperclip::Errors::NotIdentifiedByImageMagickError
rescue OpenURI::HTTPError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError
next
end
end

Loading…
Cancel
Save