Fix ftl template not correctly parsing numbers

This commit is contained in:
Joseph Garrone
2024-05-11 16:06:42 +02:00
parent 1abf0bb0d7
commit 43092ce81a
4 changed files with 53 additions and 49 deletions

View File

@ -528,12 +528,23 @@
<#return '"' + object?datetime?iso_utc + '"'>
</#if>
<#local isNumber = "">
<#attempt>
<#local isNumber = object?is_number>
<#recover>
<#return "ABORT: Can't test if it's a number">
</#attempt>
<#if isNumber>
<#return object?c>
</#if>
<#attempt>
<#return '"' + object?js_string + '"'>;
<#recover>
</#attempt>
<#return "ABORT: Couldn't convert into string non hash, non method, non boolean, non enumerable object">
<#return "ABORT: Couldn't convert into string non hash, non method, non boolean, non number, non enumerable object">
</#function>
<#function is_subpath path searchedPath>