diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-03-24 12:40:55 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-03-24 12:43:55 +0100 |
commit | c8999a116ef71bef2cb28a783e4ba3d8e3cea6fa (patch) | |
tree | 5de675d578d4e3b10ccbbcee12858f1c8a7c0eb0 /app/helpers/application_helper.rb | |
parent | 7cd3de3494834abfefc405b958da9898780fcb40 (diff) |
Sanitize remote html in atom feeds, API (not just UI), use cached mention
relations on Status#mentions
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dad7ed349..04eec89df 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -12,6 +12,14 @@ module ApplicationHelper id.start_with?("tag:#{Rails.configuration.x.local_domain}") end + def content_for_status(actual_status) + if actual_status.local? + linkify(actual_status) + else + sanitize(actual_status.content, tags: %w(a br p), attributes: %w(href rel)) + end + end + def linkify(status) mention_hash = {} status.mentions.each { |m| mention_hash[m.acct] = m } |