Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - app/controllers/about_controller.rb - app/controllers/tags_controller.rb - app/views/about/show.html.haml - spec/views/about/show.html.haml_spec.rb
This commit is contained in:
@@ -56,4 +56,12 @@ module HomeHelper
|
||||
'emojify'
|
||||
end
|
||||
end
|
||||
|
||||
def optional_link_to(condition, path, options = {}, &block)
|
||||
if condition
|
||||
link_to(path, options, &block)
|
||||
else
|
||||
content_tag(:div, &block)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -47,6 +47,15 @@ module JsonLdHelper
|
||||
!uri.start_with?('http://', 'https://')
|
||||
end
|
||||
|
||||
def invalid_origin?(url)
|
||||
return true if unsupported_uri_scheme?(url)
|
||||
|
||||
needle = Addressable::URI.parse(url).host
|
||||
haystack = Addressable::URI.parse(@account.uri).host
|
||||
|
||||
!haystack.casecmp(needle).zero?
|
||||
end
|
||||
|
||||
def canonicalize(json)
|
||||
graph = RDF::Graph.new << JSON::LD::API.toRdf(json, documentLoader: method(:load_jsonld_context))
|
||||
graph.dump(:normalize)
|
||||
|
Reference in New Issue
Block a user