RE: [SMARTY] Using Smarty for simple things only

From: Date: Fri, 04 Apr 2003 20:05:47 +0000
Subject: RE: [SMARTY] Using Smarty for simple things only
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9107@lists.php.net to get a copy of this message
Write a prefilter that strips out functions and modifiers. That would be the most efficient way to do it. Testing for this on every invocation wouldn't be worth the extra overhead. Monte On Fri, 2003-04-04 at 13:49, Pamphile, Mr. Marcel (CEC) wrote: > >If I was going to allow others to submit templates, they shouldn't be able > >to mess it up too much... > > That's exactly why. > > I could strip php code with strip_tags... But how do I make sure templates > only > display information from smarty structured variables and arrays. > > > -----Original Message----- > From: Tom Sommer [mailto:webmaster@tsn.dk] > Sent: Friday, April 04, 2003 2:31 PM > To: smarty-general@lists.php.net > Subject: Re: [SMARTY] Using Smarty for simple things only > > > On 04 Apr 2003 13:18:54 -0600, Monte Ohrt wrote: > > > I never tried it... You could remove all the plugins, that would limit > > things quite a bit. Built-in functions would still work. You would > > probably still want things like {section} function to loop over arrays > > of variables. Be sure to turn on security to disable php code. > > > What do you gain by disabling everything anyways? Just don't use them. > > If I was going to allow others to submit templates, they shouldn't be able > to mess it up too much... > > how about > $smarty->disable_autoregister_plugins = true; > or something? > > -- > Tom Sommer, Denmark > www.tsn.dk - www.dreamcoder.dk > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Monte Ohrt <monte@ispi.net>

« previous php.smarty.general (#9107) next »