From 7c2b657b0e628585eca0f0e2d9cc1b029a020b80 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Thu, 1 Jun 2017 15:10:26 +0200 Subject: [PATCH] fix bug with special characters when truncating activities titles --- app/helpers/activity_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/activity_helper.rb b/app/helpers/activity_helper.rb index f65882547..965e828a2 100644 --- a/app/helpers/activity_helper.rb +++ b/app/helpers/activity_helper.rb @@ -9,7 +9,7 @@ module ActivityHelper else title = truncate(activity_title, length: len) end - message = message.gsub(/#{activity_title}/, title ) + message = message.gsub(/#{Regexp.escape(activity_title)}/, title ) end sanitize_input(message) if message end