diff options
author | Stan Hu <stanhu@gmail.com> | 2015-10-12 21:43:24 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-10-12 22:24:19 -0700 |
commit | d02d02c672bcac0d2ef46204d132645bc69827a8 (patch) | |
tree | c0052740b3617bcba60174238f93f1ea108f6709 /app/controllers | |
parent | e12b6f30efef3f607cacc5da51f8c49c3be4643a (diff) | |
download | gitlab-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.rb | 7 |
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 |