|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Soren Smarty n00b
Joined: 23 Dec 2011 Posts: 4
|
Posted: Tue Mar 18, 2014 12:50 pm Post subject: SVN revision 4821 has compile bug |
|
|
There is template (fragment):
Code: |
{if $form_errors|default:[]}
<div class="errors">
<ul>
{foreach $form_errors as $error_key => $error}
<li>{$error}</li>
{/foreach}
</ul>
</div>
{/if}
|
In SVN revision 4820 it compiles into:
Code: |
<?php if ((($tmp = @$_smarty_tpl->tpl_vars['form_errors']->value)===null||$tmp==='' ? array() : $tmp)) {?>
<div class="errors">
<ul>
<?php $_smarty_tpl->tpl_vars['error'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['error']->_loop = false;
$_smarty_tpl->tpl_vars['error_key'] = new Smarty_Variable;
$_from = $_smarty_tpl->tpl_vars['form_errors']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['error']->key => $_smarty_tpl->tpl_vars['error']->value) {
$_smarty_tpl->tpl_vars['error']->_loop = true;
$_smarty_tpl->tpl_vars['error_key']->value = $_smarty_tpl->tpl_vars['error']->key;
?>
<li><?php echo $_smarty_tpl->tpl_vars['error']->value;?>
</li>
<?php } ?>
</ul>
</div>
<?php }?>
|
Since revision 4821 it compiles into:
Code: |
{if $form_errors|default:[]}
<div class="errors">
<ul>
{foreach $form_errors as $error_key => $error}
<li><?php echo $_smarty_tpl->tpl_vars['error']->value;?>
</li>
{/foreach}
</ul>
</div>
{/if}
|
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Mar 20, 2014 10:14 pm Post subject: |
|
|
This is now fixed in the SVN trunk |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|