Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions app/controllers/sotechsha2_pages_controller.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/controllers/sotechsha_pages_controller.rb

This file was deleted.

11 changes: 8 additions & 3 deletions app/models/book.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ def find(title)
end

def exist?(title, page)
page.nil? ?
self.find(title).any? :
self.find(title).map(&:filename).include?(page + ".html")
return false unless page.present?

view_paths = [
Rails.root.join("app/views/books/#{title}/#{page}.html.erb"),
Rails.root.join("app/views/#{title}/#{page}.html.erb")
]

view_paths.any? { |path| File.exist?(path) }
end
end

Expand Down
46 changes: 0 additions & 46 deletions config/brakeman.ignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
{
"ignored_warnings": [
{
"warning_type": "Dynamic Render Path",
"warning_code": 15,
"fingerprint": "69b5a133fab8ea617d2581423cefaf077b9366e683c5fac715647bddeec7f50a",
"check_name": "Render",
"message": "Render path contains parameter value",
"file": "app/controllers/sotechsha_pages_controller.rb",
"line": 5,
"link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
"code": "render(action => \"sotechsha_pages/#{params[:page]}\", {})",
"render_path": null,
"location": {
"type": "method",
"class": "SotechshaPagesController",
"method": "show"
},
"user_input": "params[:page]",
"confidence": "Medium",
"cwe_id": [
22
],
"note": ""
},
{
"warning_type": "Command Injection",
"warning_code": 14,
Expand Down Expand Up @@ -188,29 +165,6 @@
],
"note": ""
},
{
"warning_type": "Dynamic Render Path",
"warning_code": 15,
"fingerprint": "c54623ebce2c2053b95088b9da8112aee962e7cadd79bd9b4b9afdedaddc15b1",
"check_name": "Render",
"message": "Render path contains parameter value",
"file": "app/controllers/sotechsha2_pages_controller.rb",
"line": 5,
"link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
"code": "render(action => \"sotechsha2_pages/#{params[:page]}\", {})",
"render_path": null,
"location": {
"type": "method",
"class": "Sotechsha2PagesController",
"method": "show"
},
"user_input": "params[:page]",
"confidence": "Medium",
"cwe_id": [
22
],
"note": ""
},
{
"warning_type": "Cross-Site Scripting",
"warning_code": 2,
Expand Down