You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
, the $total variable is computed even when not needed. This might be slow (I use iterators for very large resultsets) and it will also break one-way iterators (iterators that can only be iterated over once, not having a way of implementing the rewind() method).
I have attached a testcase. The rewind function should only get called once in this case smarty bug testcase.zip
This is now fixed in the master branch and will later be included in 3.1.33
Please note that the total property is required and will be computed also when you are using some other propteries like last and show
In Smarty_Internal_Runtime_Foreach
, the $total variable is computed even when not needed. This might be slow (I use iterators for very large resultsets) and it will also break one-way iterators (iterators that can only be iterated over once, not having a way of implementing the rewind() method).
I have attached a testcase. The rewind function should only get called once in this case
smarty bug testcase.zip
To fix this, please take a look at the attached patch:
Smarty_Internal_Runtime_Foreach.zip
Expected output:
Real output:
The text was updated successfully, but these errors were encountered: