diff --git a/app/assets/stylesheets/location.css b/app/assets/stylesheets/location.css index b5f1ee32ba..76903a0366 100644 --- a/app/assets/stylesheets/location.css +++ b/app/assets/stylesheets/location.css @@ -20,6 +20,9 @@ margin: 0; } +#blurred-location-modal .modal-content { + margin-top: 0; +} #blurred-location-modal .small-description { font-size: 0.9rem; color: #808080; diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 06ae7ecdb8..3ab5f69194 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -274,7 +274,6 @@ def moderate user = User.find params[:id] if logged_in_as(['admin', 'moderator']) user.moderate - flash[:notice] = 'The user has been moderated.' else flash[:error] = 'Only moderators can moderate other users.' end diff --git a/app/models/comment.rb b/app/models/comment.rb index 6078bc18ce..19b90a08c9 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -473,7 +473,14 @@ def render_body if !trimmed_content? && parsed.present? body = parsed[:body] + COMMENT_FILTER + parsed[:boundary] + parsed[:quote] end - body + + allowed_tags = %w(a acronym b strong i em li ul ol h1 h2 h3 h4 h5 h6 blockquote br cite sub sup ins p iframe del hr img input code table thead tbody tr th td span dl dt dd div) + + # Sanitize the HTML (remove malicious attributes, unallowed tags...) + sanitized_body = ActionController::Base.helpers.sanitize(body, tags: allowed_tags) + + # Properly parse HTML (close incomplete tags...) + Nokogiri::HTML::DocumentFragment.parse(sanitized_body).to_html end def self.find_by_tag_and_author(tagname, userid) diff --git a/app/models/tag.rb b/app/models/tag.rb index 634c88f215..a291dece45 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -7,16 +7,6 @@ class Tag < ApplicationRecord has_many :node_tag, foreign_key: 'tid' # we're not really using the filter_by_type stuff here: - has_many :node, through: :drupal_node_tag do - def filter_by_type(type, limit = 10) - where(status: 1, type: type) - .limit(limit) - .order('created DESC') - end - end - - # the following probably never gets used; tag.node will use the above definition. - # also, we're not really using the filter_by_type stuff here: has_many :node, through: :node_tag do def filter_by_type(type, limit = 10) where(status: 1, type: type) diff --git a/app/views/sidebar/_dashboard.html.erb b/app/views/sidebar/_dashboard.html.erb index 69bca8c0d8..0252f2c010 100644 --- a/app/views/sidebar/_dashboard.html.erb +++ b/app/views/sidebar/_dashboard.html.erb @@ -16,8 +16,17 @@ + +<% if current_user %> +
+ Add your location +

+ Add your location to see work near you
+ About location privacy » +

+
+<% end %> -