Skip to content

Commit d0721d3

Browse files
committed
placate brakeman...
1 parent df9bb73 commit d0721d3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/controllers/docs_controller.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ def set_doc_path
3939
raise ActionController::RoutingError, "Invalid documentation path"
4040
end
4141

42-
erb_path = Rails.root.join("app", "views", "docs", "#{slug}.md.erb")
43-
md_path = Rails.root.join("app", "views", "docs", "#{slug}.md")
42+
docs_dir = Rails.root.join("app", "views", "docs")
43+
erb_path = docs_dir.join("#{slug}.md.erb")
44+
md_path = docs_dir.join("#{slug}.md")
4445

4546
@doc_file_path = File.exist?(erb_path) ? erb_path : md_path
4647
end

app/views/addresses/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Strip country code prefix for display (it's shown separately)
99
raw_phone = address.phone_number.presence || current_identity&.phone_number
1010
display_phone = if raw_phone.present? && raw_phone.start_with?("+")
11-
raw_phone.sub(/^\+#{initial_calling_code}/, "")
11+
raw_phone.sub(/^\+#{Regexp.escape(initial_calling_code)}/, "")
1212
else
1313
raw_phone
1414
end

0 commit comments

Comments
 (0)