summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-10-12 21:43:24 -0700
committerStan Hu <stanhu@gmail.com>2015-10-12 22:24:19 -0700
commitd02d02c672bcac0d2ef46204d132645bc69827a8 (patch)
treec0052740b3617bcba60174238f93f1ea108f6709 /app/controllers
parente12b6f30efef3f607cacc5da51f8c49c3be4643a (diff)
downloadgitlab-ce-d02d02c672bcac0d2ef46204d132645bc69827a8.tar.gz
Fix error preventing displaying of commit data for a directory with a leading dot
Closes https://github.com/gitlabhq/gitlabhq/issues/8763
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/refs_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb
index 6080c849c8d..c4e18c17077 100644
--- a/app/controllers/projects/refs_controller.rb
+++ b/app/controllers/projects/refs_controller.rb
@@ -3,6 +3,7 @@ class Projects::RefsController < Projects::ApplicationController
include TreeHelper
before_action :require_non_empty_project
+ before_action :validate_ref_id
before_action :assign_ref_vars
before_action :authorize_download_code!
@@ -71,4 +72,10 @@ class Projects::RefsController < Projects::ApplicationController
format.js
end
end
+
+ private
+
+ def validate_ref_id
+ return not_found! if params[:id].present? && params[:id] !~ Gitlab::Regex.git_reference_regex
+ end
end