diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-08-18 09:08:03 -0700 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-08-19 09:34:17 -0700 |
commit | 980a33552ef9933b4aa77558a607a9560c983c53 (patch) | |
tree | dfaf7fb49880b027fa3698002d05ca22a2d919d3 | |
parent | 2941cbb897d8965360cef94ab7048f60553d32e8 (diff) | |
download | gitlab-ce-980a33552ef9933b4aa77558a607a9560c983c53.tar.gz |
Use File.join instead of Rails.root.join in HelpController
-rw-r--r-- | app/controllers/help_controller.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 8a45dc8860d..71831c5380d 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -10,7 +10,8 @@ class HelpController < ApplicationController respond_to do |format| format.any(:markdown, :md, :html) do - path = Rails.root.join('doc', @category, "#{@file}.md") + # Note: We are purposefully NOT using `Rails.root.join` + path = File.join(Rails.root, 'doc', @category, "#{@file}.md") if File.exist?(path) @markdown = File.read(path) @@ -24,7 +25,8 @@ class HelpController < ApplicationController # Allow access to images in the doc folder format.any(:png, :gif, :jpeg) do - path = Rails.root.join('doc', @category, "#{@file}.#{params[:format]}") + # Note: We are purposefully NOT using `Rails.root.join` + path = File.join(Rails.root, 'doc', @category, "#{@file}.#{params[:format]}") if File.exist?(path) send_file(path, disposition: 'inline') |