Beim URL-Unescapen von UTF-8 ins internen Encoding wandeln, sofern benötigt
[kivitendo-erp.git] / SL / Form.pm
index 6785c3a..6b1ee50 100644 (file)
@@ -263,9 +263,6 @@ sub new {
 
   _recode_recursively(SL::Iconv->new($encoding, $db_charset), $self);
 
-  $self->{action}  =  lc $self->{action};
-  $self->{action}  =~ s/( |-|,|\#)/_/g;
-
   #$self->{version} =  "2.6.1";                 # Old hardcoded but secure style
   open VERSION_FILE, "VERSION";                 # New but flexible code reads version from VERSION-file
   $self->{version} =  <VERSION_FILE>;
@@ -397,6 +394,7 @@ sub unescape {
   $str =~ s/\\$//;
 
   $str =~ s/%([0-9a-fA-Z]{2})/pack("c",hex($1))/eg;
+  $str =  Encode::decode('utf-8-strict', $str) if $::locale->is_utf8;
 
   $main::lxdebug->leave_sub(2);
 
@@ -682,7 +680,6 @@ EOT
   print <<EOT;
   <link rel="stylesheet" href="css/jquery.autocomplete.css" type="text/css" />
   <meta name="robots" content="noindex,nofollow" />
-  <script type="text/javascript" src="js/highlight_input.js"></script>
   <link rel="stylesheet" type="text/css" href="css/tabcontent.css" />
   <script type="text/javascript" src="js/tabcontent.js">
 
@@ -765,9 +762,8 @@ sub _prepare_html_template {
     $file = "templates/webpages/${file}.html";
 
   } else {
-    my $info = "Web page template '${file}' not found.\n" .
-      "Please re-run 'locales.pl' in 'locale/${language}'.";
-    print(qq|<pre>$info</pre>|);
+    my $info = "Web page template '${file}' not found.\n";
+    print qq|<pre>$info</pre>|;
     ::end_of_request();
   }
 
@@ -1328,6 +1324,7 @@ sub parse_template {
       my $numbytes = (-s $self->{tmpfile});
       open(IN, $self->{tmpfile})
         or $self->error($self->cleanup . "$self->{tmpfile} : $!");
+      binmode IN;
 
       $self->{copies} = 1 unless $self->{media} eq 'printer';