Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

include_php in SmartyBC class missing?

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 96

PostPosted: Thu Dec 22, 2011 4:09 pm    Post subject: include_php in SmartyBC class missing? Reply with quote

The error SmartyException("{include_php} is deprecated, use SmartyBC class to enable"); in smarty_internal_compile_include_php.php, tells to use the SmartyBC class, but is that maybe missing in there?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Dec 22, 2011 4:42 pm    Post subject: Reply with quote

Just include the SmartyBC.class.pnp file and create the $smarty instance using SmartyBC.

$smarty = new SmartyBC()
Back to top
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 96

PostPosted: Thu Dec 22, 2011 5:31 pm    Post subject: Reply with quote

Is it that easy?
I am sorry digging into, without me knowing if I ever will use it personally, but...
Which method or property in SmartyBC() takes care about it? None, as I can see in include_php.php. It just asks, if BC instance exists.
But if anybody needs to clone this part only, partitially per demand, the one has no other possibility else to generally extend SmartyBC(). Couldn't this be done better?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Dec 22, 2011 5:42 pm    Post subject: Reply with quote

The better solution is not to use {include_php} at all but write a funtion plugin instead.

{include_php} does open doors for code injection.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 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