Open alexhass opened 10 years ago
Looked into the lib and found a solution.
Changed line if ( isNumeric( input )) {
to if ( isNumeric( input ) || isBoolean( Input ) ) {
.
if ( ( hint == "string" ) || ( hint == "any" ) ) {
// If the string appears to be numeric or boolean, then we have to prefix it to make sure
// ColdFusion doesn't accidentally convert it to a number or boolean value.
if ( isNumeric( input ) || isBoolean( Input ) ) {
writeOutput( """" & input & """" );
} else {
writeOutput( serializeJson( input ) );
}
I verified that both YES and NO works.
I found this same bug recently, and came up with the same solution.
We also ran into the same issue, and ended up resolving it the same way. Would be nice if it was rolled into the main library. Will submit a pull request if needed.
We found a bug. If a string has a value "NO" what is ISO code of Norwegian it get's converted to "false". This is not correct and should be kept as is as it is a string.
The string must not change as it is a string and not boolean. Any idea how this can be solved in CF10?