From 4e8a42b55b7dfce191bd84a1ed31b3831db9f7fb Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 9 Jan 2008 15:34:01 +0100 Subject: [PATCH] default_escape on the templates --- NDWeb/Include.pm | 2 +- NDWeb/Pages/AddIntel.pm | 2 +- NDWeb/Pages/Calls.pm | 4 ++-- NDWeb/Pages/Intel.pm | 2 +- NDWeb/Pages/Main.pm | 2 +- NDWeb/XMLPage.pm | 3 ++- templates/calls.tmpl | 2 +- templates/editRaid.tmpl | 4 ++-- templates/forum.tmpl | 2 +- templates/intel.tmpl | 2 +- templates/main.tmpl | 4 ++-- templates/raids.tmpl | 4 ++-- templates/viewthread.tmpl | 2 +- 13 files changed, 18 insertions(+), 17 deletions(-) diff --git a/NDWeb/Include.pm b/NDWeb/Include.pm index 2f062bc..5794b46 100644 --- a/NDWeb/Include.pm +++ b/NDWeb/Include.pm @@ -65,7 +65,7 @@ sub alliances { my ($alliance) = @_; my @alliances; $alliance = -1 unless defined $alliance; - push @alliances,{Id => -1, Name => ' ', Selected => not $alliance}; + push @alliances,{Id => -1, Name => '', Selected => not $alliance}; my $query = $ND::DBH->prepare(q{SELECT id,name FROM alliances ORDER BY LOWER(name)}); $query->execute; while (my $ally = $query->fetchrow_hashref){ diff --git a/NDWeb/Pages/AddIntel.pm b/NDWeb/Pages/AddIntel.pm index 529d4c2..834fb0d 100644 --- a/NDWeb/Pages/AddIntel.pm +++ b/NDWeb/Pages/AddIntel.pm @@ -95,7 +95,7 @@ sub render_body { } } if (my $thread = addForumThread $DBH,$board,$ND::UID,$subject){ - $error .= p 'Intel message added' if addForumPost $DBH,$thread,$ND::UID,param('intel') + $error .= 'Intel message added' if addForumPost $DBH,$thread,$ND::UID,param('intel') } } } diff --git a/NDWeb/Pages/Calls.pm b/NDWeb/Pages/Calls.pm index 9ab76dd..27e88de 100644 --- a/NDWeb/Pages/Calls.pm +++ b/NDWeb/Pages/Calls.pm @@ -123,7 +123,7 @@ sub render_body { $BODY->param(DefensePoints => $call->{defense_points}); $BODY->param(LandingTick => $call->{landing_tick}); $BODY->param(ETA => $call->{landing_tick}-$self->{TICK}); - $BODY->param(Info => escapeHTML $call->{info}); + $BODY->param(Info => $call->{info}); $BODY->param(DC => $call->{dc}); $BODY->param(Member => $call->{member}); $BODY->param(SMS => $call->{sms}); @@ -294,7 +294,7 @@ sub render_body { $call->{dcstyle} = 'Hostile' unless defined $call->{dc}; $i++; $call->{ODD} = $i % 2; - $call->{shiptype} = escapeHTML($call->{shiptype}); + $call->{shiptype} = $call->{shiptype}; push @calls, $call; } $BODY->param(Calls => \@calls); diff --git a/NDWeb/Pages/Intel.pm b/NDWeb/Pages/Intel.pm index b129265..3dc69b2 100644 --- a/NDWeb/Pages/Intel.pm +++ b/NDWeb/Pages/Intel.pm @@ -158,7 +158,7 @@ sub render_body { $BODY->param(Nick => escapeHTML($planet->{nick})); $BODY->param(Channel => $planet->{channel}); my @status; - for my $status (" ","Friendly", "NAP", "Hostile"){ + for my $status ("","Friendly", "NAP", "Hostile"){ push @status,{Status => $status, Selected => defined $planet->{planet_status} && $status eq $planet->{planet_status}} } $BODY->param(PlanetStatus => \@status); diff --git a/NDWeb/Pages/Main.pm b/NDWeb/Pages/Main.pm index 8bcbdc4..62d91f3 100644 --- a/NDWeb/Pages/Main.pm +++ b/NDWeb/Pages/Main.pm @@ -177,7 +177,7 @@ sub render_body { } $i++; $call->{ODD} = $i % 2; - $call->{shiptype} = escapeHTML($call->{shiptype}); + $call->{shiptype} = $call->{shiptype}; push @calls, $call; } $BODY->param(Calls => \@calls); diff --git a/NDWeb/XMLPage.pm b/NDWeb/XMLPage.pm index eb25c68..76c6374 100644 --- a/NDWeb/XMLPage.pm +++ b/NDWeb/XMLPage.pm @@ -90,7 +90,8 @@ sub render : method { $template = HTML::Template->new(filename => "templates/xml.tmpl", cache => 1); $body = HTML::Template->new(filename => "templates/$self->{PAGE}.xml.tmpl", cache => 1); }else{ - $body = HTML::Template->new(filename => "templates/$self->{PAGE}.tmpl", global_vars => 1, cache => 1); + $body = HTML::Template->new(filename => "templates/$self->{PAGE}.tmpl", global_vars => 1 + , cache => 1, default_escape => 'HTML'); $body->param(PAGE => $self->{PAGE}); } diff --git a/templates/calls.tmpl b/templates/calls.tmpl index 467fcd4..63dde79 100644 --- a/templates/calls.tmpl +++ b/templates/calls.tmpl @@ -157,7 +157,7 @@ () - + diff --git a/templates/editRaid.tmpl b/templates/editRaid.tmpl index 0b176c3..13ae19d 100644 --- a/templates/editRaid.tmpl +++ b/templates/editRaid.tmpl @@ -36,7 +36,7 @@

Raid message here

- +

List all target coords here

@@ -94,7 +94,7 @@

Comment:
- +

diff --git a/templates/forum.tmpl b/templates/forum.tmpl index f1b3b26..b74de1f 100644 --- a/templates/forum.tmpl +++ b/templates/forum.tmpl @@ -10,7 +10,7 @@ Make this thread - +

Mark threads as read

diff --git a/templates/intel.tmpl b/templates/intel.tmpl index 4158ad6..20a4607 100644 --- a/templates/intel.tmpl +++ b/templates/intel.tmpl @@ -79,7 +79,7 @@
- +
New Reply diff --git a/templates/main.tmpl b/templates/main.tmpl index 5356cdd..7dd2a46 100644 --- a/templates/main.tmpl +++ b/templates/main.tmpl @@ -1,7 +1,7 @@
Message from HC EDIT - +
@@ -50,7 +50,7 @@ - + diff --git a/templates/raids.tmpl b/templates/raids.tmpl index af9bc30..203d31c 100644 --- a/templates/raids.tmpl +++ b/templates/raids.tmpl @@ -52,7 +52,7 @@

DO NOT JOIN A WAVE UNLESS YOU HAVE PERMISSION FROM THE PERSON WHO CLAIMED IT

COORDS ARE NOT SHOWN UNTIL AT LEAST 10 MIN AFTER YOUR CLAIM

Landing tick first wave:

- +
@@ -81,7 +81,7 @@
Comment - +
diff --git a/templates/viewthread.tmpl b/templates/viewthread.tmpl index 8086162..0bf6719 100644 --- a/templates/viewthread.tmpl +++ b/templates/viewthread.tmpl @@ -5,7 +5,7 @@
: - +
-- 2.39.2