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.
This commit is contained in:
evazion
2019-01-24 14:38:04 -06:00
parent 1292717c52
commit a118ec95a7

View File

@@ -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