Fix #2894: Use [[:space:]] instead of \s in regexes.
This commit is contained in:
@@ -199,7 +199,7 @@ class PostPresenter < Presenter
|
||||
end
|
||||
|
||||
def has_sequential_navigation?(params)
|
||||
return false if params[:tags] =~ /(?:^|\s)(?:order|ordfav|ordpool):/i
|
||||
return false if Tag.has_metatag?(params[:tags], :order, :ordfav, :ordpool)
|
||||
return false if params[:pool_id].present? || params[:favgroup_id].present?
|
||||
return CurrentUser.user.enable_sequential_post_navigation
|
||||
end
|
||||
|
||||
@@ -180,4 +180,14 @@ class UserPresenter
|
||||
def previous_names(template)
|
||||
user.user_name_change_requests.map { |req| template.link_to req.original_name, req }.join(", ").html_safe
|
||||
end
|
||||
|
||||
def custom_css
|
||||
user.custom_style.to_s.split(/\r\n|\r|\n/).map do |line|
|
||||
if line =~ /\A@import/
|
||||
line
|
||||
else
|
||||
line.gsub(/([^[:space:]])[[:space:]]*(?:!important)?[[:space:]]*(;|})/, "\\1 !important\\2")
|
||||
end
|
||||
end.join("\n")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user