Latte: inconsistent behaviour with auto-quoting

Notice: This thread is very old.
Cifro
Member | 245
+
0
-

Hi everyone. A found inconsistent behavior with auto-quoting in Latte from Nette v2.0.x

Update: This is fixed in 2.1-dev, but it should be fixed in 2.0.x branch too, which supports PHP 5.2 yet.

In this first case colorbox will be quoted.
Input:

{if $el->option->display == colorbox}
{/if}

Output:

<?php if ($el->option->display == 'colorbox'): endif ?>

But in this second case where we added another condition colorbox will be quoted but image won't.

Input:

{if $meta->type == image and $el->option->display == colorbox}
{/if}

Output:

<?php if ($meta->type == image and $el->option->display == 'colorbox'): endif ?>

And I think this inconsistent behavior occurs in other situation too, but I can't tell where, now.

Last edited by Cifro (2013-10-06 22:44)

enumag
Member | 2118
+
0
-

This bug is fixed in 2.1-dev.

Last edited by enumag (2013-10-06 22:33)

Cifro
Member | 245
+
0
-

I can't use 2.1-dev. I need support for PHP 5.2 which is only in Nette 2.0.x branch.

enumag
Member | 2118
+
0
-

In that case you're stuck with

{if $meta->type == 'image' and $el->option->display == 'colorbox'}
Cifro
Member | 245
+
0
-

Is there any change fix will be ported into 2.0.x branch? Please :/

Last edited by Cifro (2013-10-06 22:48)

enumag
Member | 2118
+
0
-

Well if you manage to identify the commit, maybe. Although I thing @dg said there won't be any more 2.0.x versions.

Last edited by enumag (2013-10-06 23:04)

Cifro
Member | 245
+
0
-

There are 3 commits from Jul 23, 2013, which affect this issue: