placate brakeman...

This commit is contained in:
24c02 2025-12-02 12:51:16 -05:00
parent df9bb7347a
commit d0721d3ec6
2 changed files with 4 additions and 3 deletions

View file

@ -39,8 +39,9 @@ class DocsController < ApplicationController
raise ActionController::RoutingError, "Invalid documentation path"
end
erb_path = Rails.root.join("app", "views", "docs", "#{slug}.md.erb")
md_path = Rails.root.join("app", "views", "docs", "#{slug}.md")
docs_dir = Rails.root.join("app", "views", "docs")
erb_path = docs_dir.join("#{slug}.md.erb")
md_path = docs_dir.join("#{slug}.md")
@doc_file_path = File.exist?(erb_path) ? erb_path : md_path
end

View file

@ -8,7 +8,7 @@
# Strip country code prefix for display (it's shown separately)
raw_phone = address.phone_number.presence || current_identity&.phone_number
display_phone = if raw_phone.present? && raw_phone.start_with?("+")
raw_phone.sub(/^\+#{initial_calling_code}/, "")
raw_phone.sub(/^\+#{Regexp.escape(initial_calling_code)}/, "")
else
raw_phone
end