Page 1 of 1

[fixed]Sec. error: Call to dynamic object member not allowed

Posted: Fri Jul 20, 2012 2:44 pm
by leolivier
When loading the admin page of my module (HostedVideoAlbums) which works perfectly (I hope so :)) in 1.10.3, I get the following error:

Code: Select all

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "module_file_tpl:HostedVideoAlbums;adminpanel.tpl" on line 20 "{$oneitem->$oneval}</td>" Security error: Call to dynamic object member not allowed' in D:\wamp\www\cmsms1.11b4\lib\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 656
The smarty code is:

Code: Select all

{foreach from=$itemlist item=oneitem}
{cycle values="row2,row1" assign=rowclass}
<tr class="{$rowclass}" onmouseover="this.className='{$rowclass}hover';" onmouseout="this.className='{$rowclass}';">
	{foreach from=$adminshow item=column}
		{assign var=oneval value=$column[1]}
		<td{if $column[2]} class="ctlmm_nosearch"{/if}>
		     {$oneitem->$oneval}</td>
	{/foreach}
</tr>
{/foreach}
FYI, this piece of code has been generated as-is by CTLMM (Catalog Module Maker)

All this worked perfectly in previous versions of smarty and I can't understand why it should break in new versions...
Most of my (many and sometimes big) templates use php objects in smarty so I don't want them to be broken!

Any help appreciated

Re: Security error: Call to dynamic object member not allowe

Posted: Sun Jul 22, 2012 3:46 pm
by calguy1000
Fixed in svn... I think this is another smarty bug.

Re: Security error: Call to dynamic object member not allowe

Posted: Sun Jul 22, 2012 8:05 pm
by Jean le Chauve
Great, the module work with svn 8192 :)
Thank You Calguy