Skip to content
Snippets Groups Projects
Commit 334fe865 authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Sanitize branch name and ref name

parent 9eb571f0
No related branches found
No related tags found
No related merge requests found
class Projects::BranchesController < Projects::ApplicationController
include ActionView::Helpers::SanitizeHelper
# Authorize
before_filter :require_non_empty_project
 
Loading
Loading
@@ -16,8 +17,10 @@ class Projects::BranchesController < Projects::ApplicationController
end
 
def create
branch_name = sanitize(strip_tags(params[:branch_name]))
ref = sanitize(strip_tags(params[:ref]))
result = CreateBranchService.new(project, current_user).
execute(params[:branch_name], params[:ref])
execute(branch_name, ref)
 
if result[:status] == :success
@branch = result[:branch]
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment