Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stoppeye opened this issue Mar 17, 2021 · 3 comments
Labels

Comments

@stoppeye
Copy link

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?

@NamelessCoder
Copy link
Member

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.

@ohader ohader added the bug label Jun 2, 2021
@lolli42
Copy link
Member

lolli42 commented Nov 24, 2023

todo: add test

s2b added a commit that referenced this issue Aug 11, 2024
As this is a more complicated issue, we first provide test cases and
disable them for now.

Related issue: #533
s2b added a commit that referenced this issue Aug 11, 2024
As this is a more complicated issue, we first provide test cases and
disable them for now.

Related issue: #533
@s2b
Copy link
Contributor

s2b commented Aug 11, 2024

The added (and disabled) test cases confirm that this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants