Closed dmolineus closed 5 years ago
Keep in mind though that this will not replace any insert tags that are contained within objects, since InsertTags::replaceRecursively
only applies itself recursively to arrays, not any iterable object. Should be an edge case though.
This binds the response to the insert tags which violates separation of concerns imho. The response is there to send a proper response. It should not do any other string manipulation in my opinion.
The base Response
class already does replace insert tags so…
I actually agree with @Toflar. There are cases where I do not want to replace the insert tags. I added it to not add a bc break.
At least it should be possible to disable the behaviour.
Ah I see. Okay then.
Fix issue of broken response which is caused by replacing insert tags in the json encoded content.
Background: Insert tags might return html with quotes. These quotes will break the json string.
Solution: Replace insert tags before encoding.