From a118ec95a7e334faaac30de7b6af69f60fb39a48 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 24 Jan 2019 14:38:04 -0600 Subject: [PATCH] dynamic requests: fix editing forum posts containing requests (#3824). Bug: When editing a forum post (other than the OP) that contained a dynamic request, the edit form didn't contain the [bur:1234] syntax. Instead it contained the full body of the request. This happened because `forum_post.body` was inadvertantly mutated while rendering the request. Fixes https://github.com/r888888888/danbooru/issues/3824#issuecomment-454884235. --- app/helpers/forum_topics_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/forum_topics_helper.rb b/app/helpers/forum_topics_helper.rb index ecb5124fc..2fc818be6 100644 --- a/app/helpers/forum_topics_helper.rb +++ b/app/helpers/forum_topics_helper.rb @@ -43,7 +43,7 @@ module ForumTopicsHelper def parse_embedded_tag_request_text(text) [TagAlias, TagImplication, BulkUpdateRequest].each do |tag_request| - text.gsub!(tag_request.embedded_pattern) do |match| + text = text.gsub(tag_request.embedded_pattern) do |match| begin obj = tag_request.find($~[:id]) tag_request_message(obj) || match