X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/3a11de06f7c5a5faf40d2e81ed60ef914ea8039e..ef888d16b710a8b084c64c7758413f7bfd0bb487:/SL/AM.pm diff --git a/SL/AM.pm b/SL/AM.pm index 33f8e66cc..b2730ce50 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -965,7 +965,9 @@ sub prepare_template_filename { } $filename .= "." . ($form->{format} eq "html" ? "html" : "tex"); - $filename =~ s|.*/||; + if ($form->{"formname"} =~ m|\.\.| || $form->{"formname"} =~ m|^/|) { + $filename =~ s|.*/||; + } $display_filename = $filename; $filename = "$myconfig->{templates}/$filename"; } @@ -1009,7 +1011,7 @@ sub save_template { my $error = ""; - if (open(TEMPLATE, ">$filename")) { + if (open(TEMPLATE, ">", $filename)) { $content = Encode::encode('utf-8-strict', $content) if $::locale->is_utf8; $content =~ s/\r\n/\n/g; print(TEMPLATE $content); @@ -1333,6 +1335,7 @@ sub retrieve_units { $main::lxdebug->enter_sub(); my ($self, $myconfig, $form, $prefix) = @_; + $prefix ||= ''; my $dbh = $form->get_standard_dbh; @@ -1386,13 +1389,13 @@ sub retrieve_all_units { my $self = shift; - if (!$main::all_units) { - $main::all_units = $self->retrieve_units(\%main::myconfig, $main::form); + if (!$::request->{cache}{all_units}) { + $::request->{cache}{all_units} = $self->retrieve_units(\%main::myconfig, $main::form); } $main::lxdebug->leave_sub(); - return $main::all_units; + return $::request->{cache}{all_units}; }