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 4388 Apr 28, 2002, 4:40 PM
Thread Re: [webmaster33] File include in Global Vars?
Jagerman 4313 Apr 28, 2002, 6:24 PM
Thread Re: [Jagerman] File include in Global Vars?
webmaster33 4239 Apr 29, 2002, 5:13 AM
Thread Re: [webmaster33] File include in Global Vars?
Paul 4254 Apr 29, 2002, 5:43 AM
Thread Re: [Paul] File include in Global Vars?
webmaster33 4251 Apr 29, 2002, 6:15 AM
Thread Re: [webmaster33] File include in Global Vars?
Paul 4212 Apr 29, 2002, 6:56 AM
Thread Re: [Paul] File include in Global Vars?
webmaster33 4227 Apr 29, 2002, 8:25 AM
Post Post deleted by Paul
Paul 4254 Apr 29, 2002, 9:12 AM
Post Re: [Paul] File include in Global Vars?
webmaster33 4221 Apr 29, 2002, 10:01 AM
Thread Re: [webmaster33] File include in Global Vars?
Alex 4181 Apr 29, 2002, 12:01 PM
Thread Re: [Alex] File include in Global Vars?
webmaster33 4170 Apr 29, 2002, 1:49 PM
Thread Re: [webmaster33] File include in Global Vars?
Paul 4185 Apr 29, 2002, 1:54 PM
Thread Re: [Paul] File include in Global Vars?
webmaster33 4223 Apr 29, 2002, 2:10 PM
Thread Re: [webmaster33] File include in Global Vars?
Alex 4174 Apr 29, 2002, 3:23 PM
Post Re: [Alex] File include in Global Vars?
webmaster33 4171 Apr 29, 2002, 4:04 PM