diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-28 19:12:05 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-28 19:12:05 +0000 |
commit | ba25a793bbc061e268620717cfcab7bfdbc3d8b0 (patch) | |
tree | da39a6b2d2d277ceef88f8dd9923674199c83043 /LedgerSMB | |
parent | 9c2a0d87e96ed5301515c8c58efeda3ef98552f6 (diff) |
Adding some limitations to template format names
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1673 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-x | LedgerSMB/Template.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/LedgerSMB/Template.pm b/LedgerSMB/Template.pm index 31b98a3c..ad48ad52 100755 --- a/LedgerSMB/Template.pm +++ b/LedgerSMB/Template.pm @@ -137,6 +137,9 @@ sub new { bless $self, $class; + if ($self->{format} !~ /^\p{IsAlnum}+$/) { + throw Error::Simple "Invalid format"; + } if (!$self->{include_path}){ $self->{include_path} = $self->{'myconfig'}->{'templates'}; if (defined $self->{language}){ @@ -169,6 +172,9 @@ sub _valid_language { sub render { my $self = shift; my $vars = shift; + if ($self->{format} !~ /^\p{IsAlnum}+$/) { + throw Error::Simple "Invalid format"; + } my $format = "LedgerSMB::Template::$self->{format}"; eval "require $format"; @@ -217,6 +223,9 @@ sub _http_output { my $self = shift; my $data = shift; $data ||= $self->{output}; + if ($self->{format} !~ /^\p{IsAlnum}+$/) { + throw Error::Simple "Invalid format"; + } my $format = "LedgerSMB::Template::$self->{format}"; my $disposition = "\n"; my $name = $format->can('postprocess')->($self); |