html-template-users Mailing List for HTML::Template (Page 107)
Brought to you by:
samtregar
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(42) |
Jul
(80) |
Aug
(77) |
Sep
(97) |
Oct
(65) |
Nov
(80) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(63) |
Feb
(47) |
Mar
(45) |
Apr
(63) |
May
(67) |
Jun
(51) |
Jul
(78) |
Aug
(37) |
Sep
(45) |
Oct
(59) |
Nov
(50) |
Dec
(70) |
2004 |
Jan
(23) |
Feb
(90) |
Mar
(37) |
Apr
(53) |
May
(111) |
Jun
(71) |
Jul
(35) |
Aug
(58) |
Sep
(35) |
Oct
(35) |
Nov
(35) |
Dec
(20) |
2005 |
Jan
(51) |
Feb
(19) |
Mar
(20) |
Apr
(8) |
May
(26) |
Jun
(14) |
Jul
(49) |
Aug
(24) |
Sep
(20) |
Oct
(49) |
Nov
(17) |
Dec
(53) |
2006 |
Jan
(12) |
Feb
(26) |
Mar
(45) |
Apr
(19) |
May
(19) |
Jun
(13) |
Jul
(11) |
Aug
(9) |
Sep
(10) |
Oct
(16) |
Nov
(17) |
Dec
(13) |
2007 |
Jan
(9) |
Feb
(12) |
Mar
(28) |
Apr
(33) |
May
(12) |
Jun
(12) |
Jul
(19) |
Aug
(4) |
Sep
(4) |
Oct
(5) |
Nov
(5) |
Dec
(13) |
2008 |
Jan
(6) |
Feb
(7) |
Mar
(14) |
Apr
(16) |
May
(3) |
Jun
(1) |
Jul
(12) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2009 |
Jan
(9) |
Feb
|
Mar
(10) |
Apr
(1) |
May
|
Jun
(6) |
Jul
(5) |
Aug
(3) |
Sep
(7) |
Oct
(1) |
Nov
(15) |
Dec
(1) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(3) |
Mar
|
Apr
(28) |
May
|
Jun
|
Jul
(3) |
Aug
(4) |
Sep
(3) |
Oct
|
Nov
(8) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Stefan S. <ni...@de...> - 2002-06-21 18:45:25
|
> I'm taking a short cut by never exporting a boolean. I'm working on the >model if the data exists, then include this HTML with the output. So if >the conditions are never met (say, a table of people matching a >criteria, but there happen to be none), I never set that variable, and >therefore I don't want the associated HTML out there. > > Right now I'd have to stick in a bunch of extra lines to do my_var_bool >=> 1 wherever I have a my_var => $x in case if ($x) is false. > > TMPL_IF works all of the time except when the data that exists just >happens to be 0 (or anything else that is false). > > > I was first sceptical about this when reading but there is one argument why something like a TMPL_IFDEF might have some sense: I think it would be better for keeping presentation and programm seperated. Currently you have to do something in your script (creating these boolean variables) just to support the presentation which should be done by a different layer (templates). Stefan "Nine" Seifert |
From: Alex P. <al...@ho...> - 2002-06-21 18:34:55
|
Heyyy, I was just kidding, and point taken after the first time I got the email :) On Fri, 21 Jun 2002, Kenny Smith wrote: > I see what you're getting at, but in those shell script instances 0 = > success, as opposed to true. I can argue semantics too. :) > > Kenny > > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...]On Behalf Of > Alex Porras > Sent: Friday, June 21, 2002 11:09 AM > To: Kenny Smith > Cc: Tugrul Galatali; Chris Davies; > htm...@li... > Subject: RE: [htmltmpl] TMPL_IF truth vs definition > > > On Fri, 21 Jun 2002, Kenny Smith wrote: > > > 0 = true goes against everything computers stand for. > > Except for those silly shell scripts. :P > > --Alex > > > > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users > > > > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users > -- ----------------------------------------------------------------- Alex Porras | 615-228-2719 | al...@ho... ----------------------------------------------------------------- |
From: Kenny S. <ke...@jo...> - 2002-06-21 18:28:02
|
I see what you're getting at, but in those shell script instances 0 = success, as opposed to true. I can argue semantics too. :) Kenny -----Original Message----- From: htm...@li... [mailto:htm...@li...]On Behalf Of Alex Porras Sent: Friday, June 21, 2002 11:09 AM To: Kenny Smith Cc: Tugrul Galatali; Chris Davies; htm...@li... Subject: RE: [htmltmpl] TMPL_IF truth vs definition On Fri, 21 Jun 2002, Kenny Smith wrote: > 0 = true goes against everything computers stand for. Except for those silly shell scripts. :P --Alex ------------------------------------------------------- Sponsored by: ThinkGeek at http://www.ThinkGeek.com/ _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users |
From: Alex P. <al...@ho...> - 2002-06-21 18:09:16
|
On Fri, 21 Jun 2002, Kenny Smith wrote: > 0 = true goes against everything computers stand for. Except for those silly shell scripts. :P --Alex |
From: Tugrul G. <tu...@ga...> - 2002-06-21 17:04:11
|
On Fri, 2002-06-21 at 12:43, Kenny Smith wrote: > Hi Tugrul, > > I normally don't jump in on these conversations, but are you really > suggesting that TMPL_IF be true if the value of the variable is 0? 0 = true > goes against everything computers stand for. > Gah, I should have just made a local hack and kept quiet. 0 might be false to you and me, but to some people its STILL data. If I have some HTML appear only when certain variables are set, instead of creating lots of new boolean variables (since I don't know where a zero might rear its ugly head), I want to just check if the variable is set. Tugrul Galatali |
From: Kenny S. <ke...@jo...> - 2002-06-21 16:46:54
|
Hi Tugrul, I normally don't jump in on these conversations, but are you really suggesting that TMPL_IF be true if the value of the variable is 0? 0 = true goes against everything computers stand for. > TMPL_IF works all of the time except when the data that exists just > happens to be 0 (or anything else that is false). So, what you are saying is TMPL_IF is false if the data is false. Sounds like it works perfectly to me! Kenny Smith |
From: Tugrul G. <tu...@ga...> - 2002-06-21 16:19:34
|
> I don't really see why you can't take the pain and amend your CGI scripts. > What documentation warnings are you referring to, that advise against this > course of action? (I can see one warning against matching TMPL_IF to perl if > statements, but that doesn't seem to apply.) > > Consider the H::T snippet, > <TMPL_IF NAME="my_bool">...</TMPL_IF> > > In your CGI, instead of writing simply, > { my_bool => $x } > > you would write something like this, > { my_bool => defined $x } > I'm taking a short cut by never exporting a boolean. I'm working on the model if the data exists, then include this HTML with the output. So if the conditions are never met (say, a table of people matching a criteria, but there happen to be none), I never set that variable, and therefore I don't want the associated HTML out there. Right now I'd have to stick in a bunch of extra lines to do my_var_bool => 1 wherever I have a my_var => $x in case if ($x) is false. TMPL_IF works all of the time except when the data that exists just happens to be 0 (or anything else that is false). Tugrul Galatali |
From: Chris D. <Chr...@Ma...> - 2002-06-21 10:14:01
|
On Friday, June 21, 2002 3:14 UTC, Tugrul Galatali wrote: > [...] I had gotten into the habit of using TMPL_IF in the sense of if a variable is defined instead of if it is true. Now 99% of the time this just happens to work, as most defined things are also considered to be true. But that 1% needs to be dealt with. > I realize I could do this with H::T::Expr, but I don't want to go that far (and it would require changing a lot of templates ;). And I could start evaluating the defined condition in the code and exporting booleans, but that triggers the valid warning in the documentation about that. > The question I have is how to proceed: > 1) Add a flag to switch TMPL_IF to the alternate behaviour (if defined vs if true) > 2) Add another tag TMPL_IFDEF or similar. I don't really see why you can't take the pain and amend your CGI scripts. What documentation warnings are you referring to, that advise against this course of action? (I can see one warning against matching TMPL_IF to perl if statements, but that doesn't seem to apply.) Consider the H::T snippet, <TMPL_IF NAME="my_bool">...</TMPL_IF> In your CGI, instead of writing simply, { my_bool => $x } you would write something like this, { my_bool => defined $x } Here's a corresponding (trivial) truth table, from which you should be able to take the appropriate expressions: $x defined $x defined $x && $x defined $x && 1 --------------- --------------- --------------- --------------- undef undef "" "" 0 1 0 1 1 1 1 1 2 1 2 1 Chris -- Chris Davies, Manheim Online Tel. 0113 393-2004 Fax. 0870 444-0482. Mobile 07778 199069 |
From: Tatsuhiko M. <miy...@ed...> - 2002-06-21 07:11:36
|
This patch allows you to do HTML::Template->new(default_escape => 'HTML'); then your TMPL_VARs will always be HTML-escaped unless you explicitly specify ESCAPE=0, which will be a handy guard against Cross Site Scripting attacks. -- Tatsuhiko Miyagawa <miy...@ed...> diff -ruP HTML-Template-2.5.orig/Template.pm HTML-Template-2.5/Template.pm --- HTML-Template-2.5.orig/Template.pm Fri Jun 21 16:05:21 2002 +++ HTML-Template-2.5/Template.pm Fri Jun 21 16:03:29 2002 @@ -927,6 +927,7 @@ no_includes => 0, case_sensitive => 0, filter => [], + default_escape => 0, ); # load in options supplied to new() @@ -1822,7 +1823,7 @@ $which = uc($1); # which tag is it - $escape = $3 || $8; + $escape = $3 || $8 || $options->{default_escape}; $escape = 0 if $2 || $7; # ESCAPE=0 $escape = 0 unless defined($escape); diff -ruP HTML-Template-2.5.orig/test.pl HTML-Template-2.5/test.pl --- HTML-Template-2.5.orig/test.pl Fri Jun 21 16:05:21 2002 +++ HTML-Template-2.5/test.pl Fri Jun 21 16:04:56 2002 @@ -3,7 +3,7 @@ use strict; use Test; -BEGIN { plan tests => 55 }; +BEGIN { plan tests => 57 }; use HTML::Template; ok(1); @@ -717,3 +717,18 @@ filename => 'include_path/one.tmpl'); $output = $template->output; ok($output =~ /ONE/ and $output =~ /TWO/ and $output =~ /THREE/); + +# test default_escape +$template = HTML::Template->new(path => ['templates'], + filename => 'simple.tmpl', + default_escape => 'html'); +$template->param(ADJECTIVE => '"very"'); +$output = $template->output; +ok($output =~ /"very"/); + +$template = HTML::Template->new(path => ['templates'], + filename => 'escape.tmpl', + default_escape => 'html'); +$template->param(STUFF => '<>'); +$output = $template->output; +ok($output !~ /<>/); |
From: Tugrul G. <tu...@ga...> - 2002-06-21 03:14:27
|
Even though I read the documentation for HTML::Template at some point, I had gotten into the habit of using TMPL_IF in the sense of if a variable is defined instead of if it is true. Now 99% of the time this just happens to work, as most defined things are also considered to be true. But that 1% needs to be dealt with. I realize I could do this with H::T::Expr, but I don't want to go that far (and it would require changing a lot of templates ;). And I could start evaluating the defined condition in the code and exporting booleans, but that triggers the valid warning in the documentation about that. And I feel that ifdefined is fundamentally simple enough (almost simpler than if true since its almost not even logic) that it should be included. Now that I've lobbied for my cause :), I know a patch is generally a big help in getting it passed. The question I have is how to proceed: 1) Add a flag to switch TMPL_IF to the alternate behaviour (if defined vs if true) 2) Add another tag TMPL_IFDEF or similar. Tugrul Galatali |
From: Mariana A. <mar...@co...> - 2002-06-20 13:24:03
|
-----Mensaje original----- De: htm...@li... [mailto:htm...@li...] Enviado el: Jueves, 20 de Junio de 2002 10:07 a.m. Para: Mariana Ameri Asunto: Mailman results for Html-template-users This is an automated response. There were problems with the email commands you sent to Mailman via the administrative address <htm...@li...>. To obtain instructions on valid Mailman email commands, send email to <htm...@li...> with the word "help" in the subject line or in the body of the message. If you want to reach the human being that manages this mailing list, please send your message to <htm...@li...>. The following is a detailed description of the problems. >>>>> Subject line ignored: >>>>> Html-template-users Command? This message is in MIME format. Since your mail reader doe... Command? this format, some or all of this message may not be legible. Command? ------_=_NextPart_001_01C2185B.1DE3A446 Command? Content-Type: text/plain; >>>>> >>>>> Too many errors encountered; the rest of the message is ignored: > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > > > -----Mensaje original----- > De: htm...@li... > [mailto:htm...@li...] > Enviado el: Mi=E9rcoles, 19 de Junio de 2002 06:10 p.m. > Para: Mariana Ameri > Asunto: Welcome to the "Html-template-users" mailing list > > > Welcome to the Htm...@li... mailing list! > > To post to this list, send your email to: > > htm...@li... > > General information about the mailing list is at: > > https://lists.sourceforge.net/lists/listinfo/html-template-users > > If you ever want to unsubscribe or change your options (eg, switch to > or from digest mode, change your password, etc.), visit your > subscription page at: > > =20 > https://lists.sourceforge.net/lists/options/html-template-users/mariana.= > amer > i%40corp.terralycos.com > > > You can also make such adjustments via email by sending a message to: > > Htm...@li... > > with the word `help' in the subject or body (don't include the > quotes), and you will get back a message with instructions. > > You must know your password to change your options (including changing > the password, itself) or to unsubscribe. It is: > > abimic > > If you forget your password, don't worry, you will receive a monthly > reminder telling you what all your lists.sourceforge.net mailing list > passwords are, and how to unsubscribe or change your options. There > is also a button on your options page that will email your current > password to you. > > You may also have your password mailed to you automatically off of the > Web page noted above. > > ------_=_NextPart_001_01C2185B.1DE3A446 > Content-Type: text/html; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> > <HTML> > <HEAD> > <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = > charset=3Diso-8859-1"> > <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = > 5.5.2650.12"> > <TITLE>RE: Welcome to the "Html-template-users" mailing = > list</TITLE> > </HEAD> > <BODY> > <BR> > <BR> > > <P><FONT SIZE=3D2>-----Mensaje original-----</FONT> > <BR><FONT SIZE=3D2>De: = > htm...@li...</FONT> > <BR><FONT SIZE=3D2>[<A = > HREF=3D"mailto:htm...@li...">mailto= > :htm...@li...</A>]</FONT> > <BR><FONT SIZE=3D2>Enviado el: Mi=E9rcoles, 19 de Junio de 2002 06:10 = > p.m.</FONT> > <BR><FONT SIZE=3D2>Para: Mariana Ameri</FONT> > <BR><FONT SIZE=3D2>Asunto: Welcome to the = > "Html-template-users" mailing list</FONT> > </P> > <BR> > > <P><FONT SIZE=3D2>Welcome to the = > Htm...@li... mailing list!</FONT> > </P> > > <P><FONT SIZE=3D2>To post to this list, send your email to:</FONT> > </P> > > <P><FONT SIZE=3D2> = > htm...@li...</FONT> > </P> > > <P><FONT SIZE=3D2>General information about the mailing list is = > at:</FONT> > </P> > > <P><FONT SIZE=3D2> <A = > HREF=3D"https://lists.sourceforge.net/lists/listinfo/html-template-users= > " = > TARGET=3D"_blank">https://lists.sourceforge.net/lists/listinfo/html-temp= > late-users</A></FONT> > </P> > > <P><FONT SIZE=3D2>If you ever want to unsubscribe or change your = > options (eg, switch to</FONT> > <BR><FONT SIZE=3D2>or from digest mode, change your password, etc.), = > visit your</FONT> > <BR><FONT SIZE=3D2>subscription page at:</FONT> > </P> > > <P><FONT SIZE=3D2> <A = > HREF=3D"https://lists.sourceforge.net/lists/options/html-template-users/= > mariana.ameri%40corp.terralycos.com" = > TARGET=3D"_blank">https://lists.sourceforge.net/lists/options/html-templ= > ate-users/mariana.ameri%40corp.terralycos.com</A></FONT> > </P> > <BR> > > <P><FONT SIZE=3D2>You can also make such adjustments via email by = > sending a message to:</FONT> > </P> > > <P><FONT SIZE=3D2> = > Htm...@li...</FONT> > </P> > > <P><FONT SIZE=3D2>with the word `help' in the subject or body (don't = > include the</FONT> > <BR><FONT SIZE=3D2>quotes), and you will get back a message with = > instructions.</FONT> > </P> > > <P><FONT SIZE=3D2>You must know your password to change your options = > (including changing</FONT> > <BR><FONT SIZE=3D2>the password, itself) or to unsubscribe. It = > is:</FONT> > </P> > > <P><FONT SIZE=3D2> abimic</FONT> > </P> > > <P><FONT SIZE=3D2>If you forget your password, don't worry, you will = > receive a monthly</FONT> > <BR><FONT SIZE=3D2>reminder telling you what all your = > lists.sourceforge.net mailing list</FONT> > <BR><FONT SIZE=3D2>passwords are, and how to unsubscribe or change your = > options. There</FONT> > <BR><FONT SIZE=3D2>is also a button on your options page that will = > email your current</FONT> > <BR><FONT SIZE=3D2>password to you.</FONT> > </P> > > <P><FONT SIZE=3D2>You may also have your password mailed to you = > automatically off of the</FONT> > <BR><FONT SIZE=3D2>Web page noted above.</FONT> > </P> > > </BODY> > </HTML> > ------_=_NextPart_001_01C2185B.1DE3A446-- > > |