summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-08-18 09:08:03 -0700
committerRobert Speicher <rspeicher@gmail.com>2015-08-19 09:34:17 -0700
commit980a33552ef9933b4aa77558a607a9560c983c53 (patch)
treedfaf7fb49880b027fa3698002d05ca22a2d919d3
parent2941cbb897d8965360cef94ab7048f60553d32e8 (diff)
downloadgitlab-ce-980a33552ef9933b4aa77558a607a9560c983c53.tar.gz
Use File.join instead of Rails.root.join in HelpController
-rw-r--r--app/controllers/help_controller.rb6
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')