casid / jte

Secure and speedy templates for Java and Kotlin.
https://jte.gg
Apache License 2.0
737 stars 54 forks source link

Fix double backslash not escaping properly, resolves #328 #329

Closed mhdeeb closed 5 months ago

mhdeeb commented 5 months ago

I am unsure if this is the best solution but this will solve the edge case where "\" escapes the double quotation and prevents the java string from closing.

casid commented 5 months ago

Thank you for the PR and pointer in the right direction, where to fix this!

I moved the check inside the Java String condition check, so that everything is close together. https://github.com/casid/jte/commit/ceaa1d2d87007936ad523b78ad5b15f287653903

I've also added a unit test for this case.

I'm closing this PR, let me know if there's something missing!