Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [SMARTY] new modifier: number_format
Sorry, I forgot to do "Reply All" and just did plain old reply.  Sending
back to the list now.

boots wrote:

>b>FYI: Strictly, this isn't necessary as you can use PHP functions as
>b>modifiers and this one is wrapping the PHP function 1:1.
>
>rw> That's probably a good thing, IMO.  For example, the whole point of
>
>rw> using a template language is to seaparate application logic and
>rw> presentation logic.  If you allow a template designer to use
>rw> straight
>
>rw> PHP in the templates, they could mess things up significantly.  For
>
>rw> instance, they could make a call to a database and do some updates
>rw> that they're not supposed to or something like that.
>
>rw> My point is that I prefer to turn off the ability to put PHP in
>rw> templates for security and safety.  For that reason providing
>rw> wrappers for standard PHP formatting functions is a good thing,
>rw> IMO.
>
>I completely agree with this point-of-view; however, to achieve it, you
>have to first turn on Smarty's security, otherwise PHP functions are
>indeed exposed as a default. You know this, of course.
>
>You may not know that Smarty allows you to whitelist PHP functions when
>its security is turned. In this way, you can choose to expose only
>those "safe" functions that you want your designers to access. This
>implies that *merely* wrapping a function that can be more easily
>whitelisted seems superfluous and results in extra maintenance,
>documentation, etc.
>
>
You are correct, I did not know that you could do that.  Seems like that
could be quite a bit of extra overhead during runtime, though.  Might be
more efficient to just wrap the language functions that only deal with
formatting.  Maybe just give them a wrapper for sprintf() and tell them
to have fun =).

Rich

Report this thread to moderator Post Follow-up to this message
Old Post
Richard Wallace
08-13-04 01:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:39 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.