summaryrefslogtreecommitdiff
path: root/lib/api/issues.rb
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-02-14 17:07:11 -0200
committerOswaldo Ferreira <oswluizf@gmail.com>2017-02-21 13:32:49 -0300
commit2ace39f2420abf018ceef6aaad52e4917bcbab7d (patch)
treecae709a6381c80c70af5da459c3ffa992593843d /lib/api/issues.rb
parent881529495379505542033bf7fb0d91cdc5b51e8d (diff)
downloadgitlab-ce-2ace39f2420abf018ceef6aaad52e4917bcbab7d.tar.gz
Spam check and reCAPTCHA improvements28093-snippet-and-issue-spam-check-on-edit
Diffstat (limited to 'lib/api/issues.rb')
-rw-r--r--lib/api/issues.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 2b946bfd349..6d30c5d81b1 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -169,9 +169,13 @@ module API
params.delete(:updated_at)
end
+ update_params = declared_params(include_missing: false).merge(request: request, api: true)
+
issue = ::Issues::UpdateService.new(user_project,
current_user,
- declared_params(include_missing: false)).execute(issue)
+ update_params).execute(issue)
+
+ render_spam_error! if issue.spam?
if issue.valid?
present issue, with: Entities::Issue, current_user: current_user, project: user_project