Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Re: [webmaster33] File include in Global Vars?

Quote Reply
Re: [webmaster33] File include in Global Vars? In reply to
Hi,

The template parser doesn't understand the concept of globals. It just parses a template, and a hash ref of tags to do replacements of. If you allowed template tags themselves to be parsed, you are opening up the possiblity of cgi input being parsed (i.e. someone passes into your script tag=<%include /etc/passwd%>).

The application (Links SQL, GForum, etc) would need to mark ceartain tags as safe, and allow the template parser to reparse them. You couldn't preparse the tag, as you might not have all the variables, i.e.:

<%loop some_loop%>
<%global%>
<%endloop%>

When does the output of <%global%> get parsed? After it's displayed? What if the output to of global contains temlate tags, it would then get parsed as well. It gets very nasty, very quickly.

This would add a significant overhead as every global would need a separate call through GT::Template->parse. I can see the use for it in some cases, but I think the performance hit is too great.

Cheers,

Alex
--
Gossamer Threads Inc.
Subject Author Views Date
Thread File include in Global Vars? webmaster33 3790 Apr 28, 2002, 4:40 PM
Thread Re: [webmaster33] File include in Global Vars?
Jagerman 3715 Apr 28, 2002, 6:24 PM
Thread Re: [Jagerman] File include in Global Vars?
webmaster33 3651 Apr 29, 2002, 5:13 AM
Thread Re: [webmaster33] File include in Global Vars?
Paul 3661 Apr 29, 2002, 5:43 AM
Thread Re: [Paul] File include in Global Vars?
webmaster33 3661 Apr 29, 2002, 6:15 AM
Thread Re: [webmaster33] File include in Global Vars?
Paul 3622 Apr 29, 2002, 6:56 AM
Thread Re: [Paul] File include in Global Vars?
webmaster33 3636 Apr 29, 2002, 8:25 AM
Post Post deleted by Paul
Paul 3667 Apr 29, 2002, 9:12 AM
Post Re: [Paul] File include in Global Vars?
webmaster33 3631 Apr 29, 2002, 10:01 AM
Thread Re: [webmaster33] File include in Global Vars?
Alex 3593 Apr 29, 2002, 12:01 PM
Thread Re: [Alex] File include in Global Vars?
webmaster33 3582 Apr 29, 2002, 1:49 PM
Thread Re: [webmaster33] File include in Global Vars?
Paul 3595 Apr 29, 2002, 1:54 PM
Thread Re: [Paul] File include in Global Vars?
webmaster33 3633 Apr 29, 2002, 2:10 PM
Thread Re: [webmaster33] File include in Global Vars?
Alex 3585 Apr 29, 2002, 3:23 PM
Post Re: [Alex] File include in Global Vars?
webmaster33 3582 Apr 29, 2002, 4:04 PM