Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
escape modifier doesn't work with versions before PHP 5.2.3

 
Post new topic   Reply to topic    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
jonyo
Smarty Rookie


Joined: 14 Feb 2011
Posts: 16

PostPosted: Mon Mar 12, 2012 7:48 pm    Post subject: escape modifier doesn't work with versions before PHP 5.2.3 Reply with quote

Took a while to figure out what was going on for one of our clients, we finally tracked it down to this PHP warning that was happening:

templates_c\1e269201f7338d87d6d69f0011b7a4d1dbf0e305.geo_tset.admin.admin.validating_login.tpl.php htmlspecialchars() expects at most 3 parameters, 4 given

Looking at both plugins/modifiercompiler.escape.php and plugins/modifier.escape.php from latest version, both result in call to htmlspecialchars() with 4 parameters. According to php.net, the 4th parameter double_encode was not added until PHP 5.2.3.

And it doesn't just "ignore" the 4th parameter, having 4 parameters actually results in a warning being thrown, and htmlspecialchars() returns an empty string which is obviously not good.

So, either need to build in some sort of PHP "version checking" and make it not use the 4th parameter (at the expense of being able to use double encoding prevention). OR somewhere on the site, need to mention this PHP 5.2.3 requirement.

Unless I'm just missing something, the only mention of PHP requirements is on the download page where it says "Smarty 3.x: PHP 5.2+" under requirements, giving the impression that it should work with PHP 5.2.0 and up when that is not the case.
Back to top
View user's profile Send private message
gcphost
Smarty Rookie


Joined: 21 Jan 2006
Posts: 8

PostPosted: Sun Jun 24, 2012 3:57 pm    Post subject: Reply with quote

ditto! needs to be fixed
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 698
Location: Germany, border to Switzerland

PostPosted: Sun Jun 24, 2012 6:16 pm    Post subject: Reply with quote

It is fixed in SVN and will be included in the upcomming release 3.1.11
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP