summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Blessing <drew@gitlab.com>2015-09-14 12:07:50 -0500
committerDrew Blessing <drew@gitlab.com>2015-11-10 15:41:49 -0600
commit752d528019fc9f9c58d458380a6594d358458b4d (patch)
treecb1375d88dd66e5dc21e5da7a8035459129e9df6
parentca25289b78e1b49148438831ad6bf165fa0ce56e (diff)
downloadgitlab-ce-752d528019fc9f9c58d458380a6594d358458b4d.tar.gz
Fix trailing space issue with merge requests and issues. Fixes #2514
-rw-r--r--CHANGELOG1
-rw-r--r--app/controllers/projects/issues_controller.rb4
-rw-r--r--app/controllers/projects/merge_requests_controller.rb4
3 files changed, 7 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 9cfcd23a9fc..939213a526b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -30,6 +30,7 @@ v 8.2.0 (unreleased)
- Fix incoming email config defaults
- MR target branch is now visible on a list view when it is different from project's default one
- Improve Continuous Integration graphs page
+ - Fix trailing whitespace issue in merge request/issue title
v 8.1.4
- Fix bug where manually merged branches in a MR would end up with an empty diff (Stan Hu)
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb
index e767efbdc0c..e74c2905e48 100644
--- a/app/controllers/projects/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -158,10 +158,12 @@ class Projects::IssuesController < Projects::ApplicationController
end
def issue_params
- params.require(:issue).permit(
+ permitted = params.require(:issue).permit(
:title, :assignee_id, :position, :description,
:milestone_id, :state_event, :task_num, label_ids: []
)
+ params[:issue][:title].strip! if params[:issue][:title]
+ permitted
end
def bulk_update_params
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index b0788a2d073..188f0cc4cea 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -276,11 +276,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def merge_request_params
- params.require(:merge_request).permit(
+ permitted = params.require(:merge_request).permit(
:title, :assignee_id, :source_project_id, :source_branch,
:target_project_id, :target_branch, :milestone_id,
:state_event, :description, :task_num, label_ids: []
)
+ params[:merge_request][:title].strip! if params[:merge_request][:title]
+ permitted
end
# Make sure merge requests created before 8.0