#75: {dynamic} tags give "Parse error: syntax error, unexpected T_STRING"
Issue attachments
Issue revisions
- new by frankw at 2010-J-12 22:58
- new by frankw at 2010-J-12 22:58
- closed by Jordi Boggiano at 2010-J-17 18:00
| Type | |
|---|---|
| State | |
| Priority | |
| Resolution | |
| Assigned to | Nobody |
| Scheduled for | 1.2.0 |
| Affected versions | 1.1.1 |
| Affected components | Plugins |
| Last change | Saturday 17 July 2010 18:00:01 UTC by Jordi Boggiano |
Short description
Adding {dynamic} tags around a block of code gives a PHP parse error
Environment
PHP 5.2.13-0.dotdeb.1 with Suhosin-Patch 0.9.7
Steps to reproduce
Code below. Remove {dynamic} tags and code works fine.
- {dynamic} {if isset($objRec)}
-
{foreach $objRec Recipient} <input type="checkbox" name="recipient[]" value="{$Recipient->RecipientID}" {foreach $objRecGroMem Member}{if ($Member->RecipientID == $Recipient->RecipientID)} checked{/if}{/foreach} /> <a href="mailto:{$Recipient->Email}">{$Recipient->Name}</a>, {$Recipient->PositionTitle}<br /> {/foreach}
{/if} {/dynamic}
Expected behavior
Display a list of checkboxes.
Actual behavior
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/emailthem/www/dwoo/compiled/home/emailthem/www/templates/manage/editgroup.html.d17.php on line 125
Jordi Boggiano at Thursday 15 July 2010 00:15:09 UTC
Tried it, could not reproduce here. Can you try using the latest Dwoo version from svn trunk or http://dwoo.org/dwoo-snapshot.tgz and see if it still occurs?
Jordi Boggiano at Thursday 15 July 2010 00:21:00 UTC
Ok, looking at your attachment I understood the problem and could find a reproduce case.. It only occurs when you nest {dynamic} tags into one another actually, the string dump fails to escape properly.. This doesn't really make sense though, so I guess the dynamic plugin should warn if you're using it within another block, or just silently do a NOOP. I'll hopefully fix that in the near future, but can't promise anything because I'm quite busy. If you want to give it a go given those informations it would be nice :)
Jordi Boggiano at Saturday 17 July 2010 18:00:01 UTC
Ok this has been fixed in git and will be replicated to svn trunk soon:
See http://github.com/Seldaek/Dwoo/commit/07e1dd9a916e4df2faa277780853cbe1304f61c1