From a8d0df11d3931d2d4db2b35453e064f556fe7bf1 Mon Sep 17 00:00:00 2001 From: Nicolas Florentin Date: Wed, 27 Jul 2022 15:59:42 +0200 Subject: [PATCH] projects/index/json.jbuilder : sanitize project description --- app/views/api/projects/index.json.jbuilder | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/api/projects/index.json.jbuilder b/app/views/api/projects/index.json.jbuilder index 15b4e3f5c..616297a2a 100644 --- a/app/views/api/projects/index.json.jbuilder +++ b/app/views/api/projects/index.json.jbuilder @@ -1,7 +1,8 @@ # frozen_string_literal: true json.projects @projects do |project| - json.extract! project, :id, :name, :description, :licence_id, :slug, :state + json.extract! project, :id, :name, :licence_id, :slug, :state + json.description sanitize(project.description) json.author_id project.author.user_id json.project_image project.project_image.attachment.medium.url if project.project_image