Fluid icon indicating copy to clipboard operation
Fluid copied to clipboard

f:if viewhelper condition evaluates string with (only) two double quotes as null/empty

Open stoppeye opened this issue 4 years ago • 3 comments

Let's say we have a PHP variable like this: $test = '""'

Then we pass this variable to a fluid template and check for it like this:

<f:if condition="{test}">value: {test}</f:if>

Result: nothing is printed.

This is (at best) non-intuitive, I'd rather see it as a bug. If a string with length 2 and containing 2 printable characters is considered null/empty, then that seems wrong. Or am I missing something?

stoppeye avatar Mar 17 '21 18:03 stoppeye

This sounds like a bug. Hardcoded strings will be stripped of quotes but it sounds like it also happens for variables which it probably shouldn't.

NamelessCoder avatar Mar 25 '21 13:03 NamelessCoder

todo: add test

lolli42 avatar Nov 24 '23 17:11 lolli42