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

[BUG] \Template doesn't render text node 0 (zero) #354

Closed
paclucio opened this issue Sep 23, 2022 · 1 comment
Closed

[BUG] \Template doesn't render text node 0 (zero) #354

paclucio opened this issue Sep 23, 2022 · 1 comment
Labels

Comments

@paclucio
Copy link

Given <check if='{{ @foo == @bar }}'><true>1</true><false>0</false></check>
the zero in the false tag is not printed.

The bug is on \Template->parse() line 280

$match[1] if is a zero evaluates to false, and isn't added to the $tree.
if (strlen($tmp) || $match[1]) needs to be if (strlen($tmp) || isset($match[1]))

Thank you ;)

@ikkez
Copy link
Member

ikkez commented Sep 25, 2022

fixed

@ikkez ikkez closed this as completed Sep 25, 2022
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

2 participants