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

Regression: nested section loops fail #140

Closed
bertptrs opened this issue Dec 21, 2015 · 2 comments
Closed

Regression: nested section loops fail #140

bertptrs opened this issue Dec 21, 2015 · 2 comments

Comments

@bertptrs
Copy link

Since the smarty 3.1.28 update, nested section loops (in either a foreach or a section) loops cause an error (undefined index). This is caused by the following line in compiled template code:

$__section_i_0_saved = isset($_smarty_tpl->tpl_vars['__smarty_section_i']) ? $_smarty_tpl->tpl_vars['__section_i'] : false;

The problem arises because the code checks whether '__smarty_section_i' exists and then tries to read '__section_i', without the smarty prefix. It only occurs in nested loops, because isset returns true the second time the loop is evaluated.

PHP version: 5.5.9
Smarty version: 3.1.28

@TAdeJong
Copy link

Can confirm from own environment with equal versions of smarty and PHP.

@uwetews
Copy link
Contributor

uwetews commented Dec 21, 2015

See #118

Also 3.1.29 is released with the bugfixes

@uwetews uwetews closed this as completed Dec 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants