Smarty 2.6.7 bug in foreach
[email protected] ("Hendy Irawan")
| Newsgroups | php.smarty.dev |
|---|---|
| Message-ID | <[email protected]> |
Hi! I'm using Smarty 2.6.7 and it seems that it has a "bug". The foreach built-in function converts the "from" to an array before foreach-ing, while it works for many cases it doesn't work for objects supporting the new Iterator interface in PHP 5. This requires change to Smarty compiler but I think it's quite trivial. You don't need to support Iterator explicitly, just don't typecast an object to array. Currently I fixed this by directly changing Smarty compiler and removing the (array) typecast. Thank you. Hendy Irawan, GaulDong - http://dev.gauldong.net