LaTeX-Druck: Unicode-Control-Zeichen und nicht druckbare Zeichen entfernen
[kivitendo-erp.git] / SL / Template / LaTeX.pm
index f5062ba..da0967b 100644 (file)
@@ -123,6 +123,9 @@ sub format_string {
     // $formatters{ $self->{default_content_type} }
     // $formatters{ text };
 
+  $content  =~ s{[^\p{Print}]|\p{Cf}}{}g;
+  $variable =~ s{[^\p{Print}]|\p{Cf}}{}g;
+
   return $formatter->($self, $content, variable => $variable);
 }
 
@@ -450,7 +453,7 @@ sub parse {
 
     my $globals = global_vars();
 
-    $::form->init_template->process(\$contents, { %$form, %$globals }, \$new_contents) || die $::form->template->error;
+    $::form->template->process(\$contents, { %$form, %$globals }, \$new_contents) || die $::form->template->error;
   } else {
     $new_contents = $self->parse_block($contents);
   }