diff --git a/app/helpers/context_helper.rb b/app/helpers/context_helper.rb index 29c64d50c7..ba28442f0d 100644 --- a/app/helpers/context_helper.rb +++ b/app/helpers/context_helper.rb @@ -26,7 +26,7 @@ module ContextHelper memorial: { 'toot' => 'http://joinmastodon.org/ns#', 'memorial' => 'toot:memorial' }, voters_count: { 'toot' => 'http://joinmastodon.org/ns#', 'votersCount' => 'toot:votersCount' }, suspended: { 'toot' => 'http://joinmastodon.org/ns#', 'suspended' => 'toot:suspended' }, - attribution_domains: { 'toot' => 'http://joinmastodon.org/ns#', 'attributionDomains' => { '@id' => 'toot:attributionDomains', '@type' => '@id' } }, + attribution_domains: { 'toot' => 'http://joinmastodon.org/ns#', 'attributionDomains' => { '@id' => 'toot:attributionDomains', '@container' => '@set' } }, profile_settings: { 'toot' => 'http://joinmastodon.org/ns#', 'showFeatured' => 'toot:showFeatured', diff --git a/app/javascript/mastodon/features/about/index.jsx b/app/javascript/mastodon/features/about/index.jsx index 85b76aee32..83f5bf6025 100644 --- a/app/javascript/mastodon/features/about/index.jsx +++ b/app/javascript/mastodon/features/about/index.jsx @@ -168,7 +168,7 @@ class About extends PureComponent {
-

+

diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 810fe1da94..8df8070ed1 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -2,7 +2,7 @@ "about.blocks": "Moderated servers", "about.contact": "Contact:", "about.default_locale": "Default", - "about.disclaimer": "Mastodon is free, open-source software, and a trademark of Mastodon gGmbH.", + "about.disclaimer": "Mastodon is free, open-source software, and a trademark of Mastodon GmbH.", "about.domain_blocks.no_reason_available": "Reason not available", "about.domain_blocks.preamble": "Mastodon generally allows you to view content from and interact with users from any other server in the fediverse. These are the exceptions that have been made on this particular server.", "about.domain_blocks.silenced.explanation": "You will generally not see profiles and content from this server, unless you explicitly look it up or opt into it by following.", diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index e616400c93..d4b38162a8 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -150,7 +150,7 @@ class ActivityPub::ProcessAccountService < BaseService @account.show_featured = @json['showFeatured'] if @json.key?('showFeatured') @account.show_media = @json['showMedia'] if @json.key?('showMedia') @account.show_media_replies = @json['showRepliesInMedia'] if @json.key?('showRepliesInMedia') - @account.attribution_domains = as_array(@json['attributionDomains'] || []).take(Account::ATTRIBUTION_DOMAINS_HARD_LIMIT).map { |item| value_or_id(item) } + @account.attribution_domains = as_array(@json['attributionDomains'] || []).take(Account::ATTRIBUTION_DOMAINS_HARD_LIMIT).filter { |item| item.is_a?(String) } end def set_fetchable_key! diff --git a/config/templates/terms-of-service.md b/config/templates/terms-of-service.md index b2e32f76b9..348bf18701 100644 --- a/config/templates/terms-of-service.md +++ b/config/templates/terms-of-service.md @@ -4,7 +4,7 @@ These terms of service (the "Terms") cover your access and use of Server Operator's ("Administrator", "we", or "us") instance, located at %{domain} (the "Instance"). These Terms apply solely to your use of the Instance as operated by the Administrator. Please note that we have no affiliation with Mastodon -gGmbH (“Mastodon”) and these Terms do not contain any representations or +GmbH (“Mastodon”) and these Terms do not contain any representations or warranties or other promises from Mastodon about your use of the Instance. If you would like to contact us for any reason, please direct all questions, comments, concerns and notices to us by following the instructions provided in diff --git a/lib/sanitize_ext/sanitize_config.rb b/lib/sanitize_ext/sanitize_config.rb index 1b216afb6b..b3cfdb6f52 100644 --- a/lib/sanitize_ext/sanitize_config.rb +++ b/lib/sanitize_ext/sanitize_config.rb @@ -93,8 +93,10 @@ class Sanitize # next, we find the plain-text description is_annotation_with_encoding = lambda do |encoding, node| return false unless node.name == 'annotation' + encoding_attr = node.attributes['encoding'] + return false if encoding_attr.nil? - node.attributes['encoding'].value == encoding + encoding_attr.value == encoding end annotation = semantics.children.find(&is_annotation_with_encoding.curry['application/x-tex']) diff --git a/spec/lib/sanitize/config_spec.rb b/spec/lib/sanitize/config_spec.rb index 7ef70a777b..71112b3174 100644 --- a/spec/lib/sanitize/config_spec.rb +++ b/spec/lib/sanitize/config_spec.rb @@ -36,6 +36,14 @@ RSpec.describe Sanitize::Config do expect(Sanitize.fragment('Test<a href="https://example.com">test</a>', subject)).to eq 'Test<a href="https://example.com">test</a>' end + it 'removes math when unparsable due to missing attributes' do + expect(Sanitize.fragment('x', subject)).to eq '' + end + + it 'removes math when unparsable due to missing encoding attribute' do + expect(Sanitize.fragment('x', subject)).to eq '' + end + it 'keeps a with href' do expect(Sanitize.fragment('Test', subject)).to eq 'Test' end