Repository navigation
[15.0][FIX] mail: handle nested braces in jinja placeholders - #6063
Open
SamyShaawat wants to merge 1 commit into
Open
SamyShaawat wants to merge 1 commit into
SamyShaawat wants to merge 1 commit into
Conversation
The regex used to convert ${...} placeholders stopped at the first closing brace, so an expression like ${create({"a": b}).name} was cut in the middle. Find the closing brace by balancing the braces and skipping quoted strings instead.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5480
The
${...}placeholders were converted with\$\{([^}]*)\}, which stops at the first}. An expression with a dict literal like${object.env["dummy.model"].create({"val": value}).name}became<t t-out='object.env["dummy.model"].create({"val": value'></t>).name}.Both the char and the html conversions now use a small helper that finds the matching closing brace by counting braces and skipping quoted strings. A placeholder that is never closed is left as it was.
I checked it with the example from the issue, plain placeholders, a
}inside a string and an unclosed placeholder. I did not run a full 14.0 -> 15.0 migration.