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

Update smarty_internal_compile_capture.php #138

Closed
wants to merge 1 commit into from

Commits on Dec 19, 2015

  1. Update smarty_internal_compile_capture.php

    Added missing ().
    
    Without them "{if}", with several "$smarty.capture.X" in condition, generates incorrect code.
    
    e.g. before this change, smarty code
    
    ```
    {if $smarty.capture.A || $smarty.capture.B}
    ```
    
    generates code
    
    ```php
    <?php if (isset($_smarty_tpl->_cache['__smarty_capture']['A']) ? $_smarty_tpl->_cache['__smarty_capture']['A'] : null || isset($_smarty_tpl->_cache['__smarty_capture']['B']) ? $_smarty_tpl->_cache['__smarty_capture']['B'] : null) {?>
    ```
    which evaluates incorrectly.
    
    After this change generated code is
    
    ```php
    <?php if ((isset($_smarty_tpl->_cache['__smarty_capture']['A']) ? $_smarty_tpl->_cache['__smarty_capture']['A'] : null) || (isset($_smarty_tpl->_cache['__smarty_capture']['B']) ? $_smarty_tpl->_cache['__smarty_capture']['B'] : null)) {?>
    ```
    which evaluates correctly.
    s4uliu5 committed Dec 19, 2015
    Configuration menu
    Copy the full SHA
    6719bc5 View commit details
    Browse the repository at this point in the history