Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.9
-
None
Description
When TemplateResource.parse is passed a path that contains multiple dots the resulting resource drops the second dot and everything that follows it from the path. For example: foo.html.tpl becomes foo.html. This truncation is the cause of this bug in Spring Boot: https://github.com/spring-projects/spring-boot/issues/2212
I believe the problem can be solved by updating the regex declared in MarkupTemplateEngine to anchor the final group to the end of the string, i.e. I believe it could be a one character fix to add a $ to the end of the pattern:
(.+?)(?:_([a-z]{2}(?:_[A-Z]{2,3})))?\\.(\\p{Alnum}+)$