diff options
Diffstat (limited to 'LedgerSMB/Form.pm')
-rwxr-xr-x | LedgerSMB/Form.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 43fa3b00..bc693ea9 100755 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -38,6 +38,7 @@ use LedgerSMB::Sysconfig; use List::Util qw(first); use LedgerSMB::Mailer; use Time::Local; +use Cwd; package Form; @@ -86,16 +87,13 @@ sub new { if ($self->{path} ne 'bin/lynx'){ $self->{path} = 'bin/mozilla';} - if (($self->{script} =~ m#(..|\\|/)#)){ - $self->error("Access Denied"); - } - if (($self->{script}) and not first {$_ eq $self->{script}} + if (($self->{script}) and not List::Util::first {$_ eq $self->{script}} @{LedgerSMB::Sysconfig::scripts}){ - $self->error('Access Denied'); + $self->error('Access Denied', __line__, __file__); } if (($self->{action} =~ /:/) || ($self->{nextsub} =~ /:/)){ - $self->error("Access Denied"); + $self->error("Access Denied", __line__, __file__); } for (keys %$self){ $self->{$_} =~ s/\000//g } @@ -592,6 +590,8 @@ sub parse_template { my ($self, $myconfig) = @_; + $self->{cwd} = Cwd::getcwd(); + my ($chars_per_line, $lines_on_first_page, $lines_on_second_page) = (0, 0, 0); my ($current_page, $current_line) = (1, 1); my $pagebreak = ""; |