Fix accessing to XML attribute in FetchAtomService (#4668)

lolsob-rspec
unarist 2017-08-23 19:25:57 +09:00 committed by Eugen Rochko
parent b13501268f
commit 75ce1235b5
1 changed files with 2 additions and 2 deletions

View File

@ -62,8 +62,8 @@ class FetchAtomService < BaseService
json_link = page.xpath('//link[@rel="alternate"]').find { |link| ['application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'].include?(link['type']) }
atom_link = page.xpath('//link[@rel="alternate"]').find { |link| link['type'] == 'application/atom+xml' }
result ||= process(json_link.href, terminal: true) unless json_link.nil? || @unsupported_activity
result ||= process(atom_link.href, terminal: true) unless atom_link.nil?
result ||= process(json_link['href'], terminal: true) unless json_link.nil? || @unsupported_activity
result ||= process(atom_link['href'], terminal: true) unless atom_link.nil?
result
end