|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
snaxor Smarty n00b
Joined: 06 Jul 2011 Posts: 3
|
Posted: Wed Jul 06, 2011 6:35 pm Post subject: 3.1RC1, escape_html and |count |
|
|
In 3.1RC1, with escape_html set to true, the |count modifier gets applied after the htmlspecialchars in the compiled template. |count works as expected when, escape_html is false.
Php:
Code: |
$smarty = new Smarty();
$smarty->escape_html = true;
$smarty->assign('test', array(1, 2, 3));
$smarty->display('test.tpl');
|
Template:
The resulting compiled code looks like this:
Code: |
<?php echo count(htmlspecialchars($_smarty_tpl->tpl_vars['test']->value, ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET));?>
|
When it should probably look like this:
Code: |
<?php echo htmlspecialchars(count($_smarty_tpl->tpl_vars['test']->value), ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET);?>
|
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Jul 06, 2011 6:58 pm Post subject: |
|
|
Yes, modifier must run first.
This bug is now fixed in the SVN Smarty_3_1_DEV branch. |
|
Back to top |
|
snaxor Smarty n00b
Joined: 06 Jul 2011 Posts: 3
|
Posted: Wed Jul 06, 2011 8:18 pm Post subject: |
|
|
U.Tews wrote: | This bug is now fixed in the SVN Smarty_3_1_DEV branch. |
Super cool. Thanks alot. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|