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 2893 Apr 28, 2002, 4:40 PM
Thread Re: [webmaster33] File include in Global Vars?
Jagerman 2826 Apr 28, 2002, 6:24 PM
Thread Re: [Jagerman] File include in Global Vars?
webmaster33 2775 Apr 29, 2002, 5:13 AM
Thread Re: [webmaster33] File include in Global Vars?
Paul 2777 Apr 29, 2002, 5:43 AM
Thread Re: [Paul] File include in Global Vars?
webmaster33 2776 Apr 29, 2002, 6:15 AM
Thread Re: [webmaster33] File include in Global Vars?
Paul 2746 Apr 29, 2002, 6:56 AM
Thread Re: [Paul] File include in Global Vars?
webmaster33 2731 Apr 29, 2002, 8:25 AM
Post Post deleted by Paul
Paul 2792 Apr 29, 2002, 9:12 AM
Post Re: [Paul] File include in Global Vars?
webmaster33 2748 Apr 29, 2002, 10:01 AM
Thread Re: [webmaster33] File include in Global Vars?
Alex 2716 Apr 29, 2002, 12:01 PM
Thread Re: [Alex] File include in Global Vars?
webmaster33 2706 Apr 29, 2002, 1:49 PM
Thread Re: [webmaster33] File include in Global Vars?
Paul 2711 Apr 29, 2002, 1:54 PM
Thread Re: [Paul] File include in Global Vars?
webmaster33 2757 Apr 29, 2002, 2:10 PM
Thread Re: [webmaster33] File include in Global Vars?
Alex 2710 Apr 29, 2002, 3:23 PM
Post Re: [Alex] File include in Global Vars?
webmaster33 2700 Apr 29, 2002, 4:04 PM